small updates

This commit is contained in:
Adam D. Ruppe 2024-04-20 08:03:00 -04:00
parent 3863c5db66
commit 26637a230c
4 changed files with 13 additions and 9 deletions

2
core.d
View File

@ -130,6 +130,8 @@ version(Windows) {
import core.sys.freebsd.sys.event;
// the version in druntime doesn't have the default arg making it a pain to use when the freebsd
// version adds a new field
extern(D) void EV_SET(kevent_t* kevp, typeof(kevent_t.tupleof) args = kevent_t.tupleof.init)
{
*kevp = kevent_t(args);

16
email.d
View File

@ -78,13 +78,13 @@ class EmailMessage {
string[] headers;
/** If you use the send method with an SMTP server, you don't want to change this.
*
* While RFC 2045 mandates CRLF as a lineseperator, there are some edge-cases where this won't work.
* When passing the E-Mail string to a unix program which handles communication with the SMTP server, some (i.e. qmail)
* expect the system lineseperator (LF) instead.
* Notably, the google mail REST API will choke on CRLF lineseps and produce strange emails (as of 2024).
*/
/++
If you use the send method with an SMTP server, you don't want to change this.
While RFC 2045 mandates CRLF as a lineseperator, there are some edge-cases where this won't work.
When passing the E-Mail string to a unix program which handles communication with the SMTP server, some (i.e. qmail)
expect the system lineseperator (LF) instead.
Notably, the google mail REST API will choke on CRLF lineseps and produce strange emails (as of 2024).
+/
string linesep = "\r\n";
private bool isMime = false;
@ -1219,7 +1219,7 @@ unittest {
mail.setTextBody(text);
mail.addAttachment("text/plain", "attachment.txt", text.representation);
// In case binary and plaintext get handled differently one day
mail.addAttachment("application/octet-stream", "attachment.bin", text.representation);
mail.addAttachment("application/octet-stream", "attachment.bin", text.representation);
auto result = new IncomingEmailMessage(mail.toString().split("\r\n"));

View File

@ -4954,7 +4954,7 @@ class WebSocket {
return true;
if(r <= 0) {
//import std.stdio; writeln(WSAGetLastError());
throw new Exception("Socket receive failed");
throw new Exception("Socket receive failed " ~ lastSocketError());
}
receiveBufferUsedLength += r;
return true;

View File

@ -13,6 +13,8 @@
// here's some D convenience functions
module stb_truetype;
@system:
struct TtfFont {
stbtt_fontinfo font;
this(in ubyte[] data) {