+void SetConnectStatus(AsyncIO *IO)
+{
+
+ SmtpOutMsg *SendMsg = IO->Data;
+ char buf[256];
+ void *src;
+
+ buf[0] = '\0';
+
+ if (IO->IP6) {
+ src = &IO->Addr.sin6_addr;
+ }
+ else {
+ unsigned long psaddr;
+ struct sockaddr_in *addr = (struct sockaddr_in *)&IO->Addr;
+
+ src = &addr->sin_addr.s_addr;
+ memcpy(&psaddr, &addr->sin_addr.s_addr, sizeof(psaddr));
+/// psaddr = ntohl(psaddr);
+/*
+ CtdlLogPrintf(CTDL_DEBUG,
+ "SMTP client[%ld]: connecting to %s [%ld.%ld.%ld.%ld:%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;
+ StrBufPrintf(SendMsg->MyQEntry->StatusMessage,
+ "Timeout while connecting %s [%ld.%ld.%ld.%ld:%d] ",
+ SendMsg->mx_host,
+ (psaddr >> 24) & 0xFF,
+ (psaddr >> 16) & 0xFF,
+ (psaddr >> 8) & 0xFF,
+ (psaddr >> 0) & 0xFF,
+ SendMsg->IO.dport);
+
+*/
+ }
+
+ inet_ntop((IO->IP6)?AF_INET6:AF_INET,
+ src,
+ buf, sizeof(buf));
+
+ CtdlLogPrintf(CTDL_DEBUG,
+ "SMTP client[%ld]: connecting to %s [%s]:%d ...\n",
+ SendMsg->n,
+ SendMsg->mx_host,
+ buf,
+ SendMsg->IO.dport);
+
+ SendMsg->MyQEntry->Status = 5;
+ StrBufPrintf(SendMsg->MyQEntry->StatusMessage,
+ "Timeout while connecting %s [%s]:%d ",
+ SendMsg->mx_host,
+ buf,
+ SendMsg->IO.dport);
+}