]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpqueue.c
libev/c-ares migration: unstack out ouf c-ares before querying new requests
[citadel.git] / citadel / modules / smtp / serv_smtpqueue.c
index b4ab587407bf325871d50ed0375229d79b0eaf16..591918ea200b5d3fc551e75e935a034770523841 100644 (file)
@@ -420,7 +420,7 @@ StrBuf *smtp_load_msg(OneQueItem *MyQItem, int n)
        if ((StrLength(SendMsg) > 0) && 
            ChrPtr(SendMsg)[StrLength(SendMsg) - 1] != '\n') {
                CtdlLogPrintf(CTDL_WARNING, 
-                             "SMTP client[%ld]: Possible problem: message did not "
+                             "SMTP client[%d]: Possible problem: message did not "
                              "correctly terminate. (expecting 0x10, got 0x%02x)\n",
                              MsgCount, //yes uncool, but best choice here... 
                              ChrPtr(SendMsg)[StrLength(SendMsg) - 1] );
@@ -649,9 +649,11 @@ int ParseURL(ParsedURL **Url, StrBuf *UrlStr, short DefaultPort)
                url->Host ++;
                pEndHost = strchr(url->Host, ']');
                if (pEndHost == NULL) {
+                       FreeStrBuf(&url->URL);
                        free(url);
                        return 0; /* invalid syntax, no ipv6 */
                }
+               StrBufPeek(url->URL, pEndHost, 0, '\0');
                if (*(pEndHost + 1) == ':'){
                        StrBufPeek(url->URL, pEndHost + 1, 0, '\0');
                        pPort = pEndHost + 2;