]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpeventclient.c
Libev migration Cleanup, print resolved IP to log
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index d13f5238e1a74183d73a11742ba94012dde5e092..fc4dc20a64ed1ee83704760ee4fc4a130f3cb088 100644 (file)
@@ -256,10 +256,19 @@ void get_one_mx_host_ip_done(void *Ctx,
        AsyncIO *IO = Ctx;
        SmtpOutMsg *SendMsg = IO->Data;
        if ((status == ARES_SUCCESS) && (hostent != NULL) ) {
+               unsigned long psaddr;
+               // TODO: IPV6
+               memcpy(&psaddr, hostent->h_addr_list[0], sizeof(psaddr));
+               psaddr = ntohl(psaddr); 
+
                CtdlLogPrintf(CTDL_DEBUG, 
-                             "SMTP client[%ld]: connecting to %s [ip]: %d ...\n", 
+                             "SMTP client[%ld]: connecting to %s [%d.%d.%d.%d:%d] ...\n", 
                              SendMsg->n, 
                              SendMsg->mx_host, 
+                             (psaddr >> 24) & 0xFF,
+                             (psaddr >> 16) & 0xFF,
+                             (psaddr >>  8) & 0xFF,
+                             (psaddr >>  0) & 0xFF,
                              SendMsg->IO.dport);
 
                SendMsg->MyQEntry->Status = 5;