]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/smtp/serv_smtpeventclient.c
add eSendFile/eReadfile in the switchs where they are still missing.
[citadel.git] / citadel / modules / smtp / serv_smtpeventclient.c
index 831857b07a28c703effbf0e2f7e39dd06f4e6e72..498d94c882c9774f66a457814017794d28a9f178 100644 (file)
@@ -90,7 +90,6 @@
 #include "smtpqueue.h"
 #include "smtp_clienthandlers.h"
 
-#ifdef EXPERIMENTAL_SMTP_EVENT_CLIENT
 const unsigned short DefaultMXPort = 25;
 void DeleteSmtpOutMsg(void *v)
 {
@@ -111,6 +110,7 @@ eNextState SMTP_C_Timeout(AsyncIO *IO);
 eNextState SMTP_C_ConnFail(AsyncIO *IO);
 eNextState SMTP_C_DispatchReadDone(AsyncIO *IO);
 eNextState SMTP_C_DispatchWriteDone(AsyncIO *IO);
+eNextState SMTP_C_DNSFail(AsyncIO *IO);
 eNextState SMTP_C_Terminate(AsyncIO *IO);
 eReadState SMTP_C_ReadServerStatus(AsyncIO *IO);
 
@@ -436,6 +436,7 @@ SmtpOutMsg *new_smtp_outmsg(OneQueItem *MyQItem,
        SendMsg->IO.Terminate     = SMTP_C_Terminate;
        SendMsg->IO.LineReader    = SMTP_C_ReadServerStatus;
        SendMsg->IO.ConnFail      = SMTP_C_ConnFail;
+       SendMsg->IO.DNSFail       = SMTP_C_DNSFail;
        SendMsg->IO.Timeout       = SMTP_C_Timeout;
        SendMsg->IO.ShutdownAbort = SMTP_C_Shutdown;
 
@@ -510,6 +511,7 @@ void SMTPSetTimeout(eNextState NextTCPState, SmtpOutMsg *pMsg)
        syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
 
        switch (NextTCPState) {
+       case eSendFile:
        case eSendReply:
        case eSendMore:
                Timeout = SMTP_C_SendTimeouts[pMsg->State];
@@ -530,6 +532,10 @@ void SMTPSetTimeout(eNextState NextTCPState, SmtpOutMsg *pMsg)
                break;
        case eSendDNSQuery:
        case eReadDNSReply:
+       case eDBQuery:
+       case eReadFile:
+       case eReadMore:
+       case eReadPayload:
        case eConnect:
        case eTerminateConnection:
        case eAbort:
@@ -587,6 +593,14 @@ eNextState SMTP_C_ConnFail(AsyncIO *IO)
        StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[pMsg->State]));
        return FailOneAttempt(IO);
 }
+eNextState SMTP_C_DNSFail(AsyncIO *IO)
+{
+       SmtpOutMsg *pMsg = IO->Data;
+
+       syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
+       StrBufPlain(IO->ErrMsg, CKEY(ReadErrors[pMsg->State]));
+       return FailOneAttempt(IO);
+}
 eNextState SMTP_C_Shutdown(AsyncIO *IO)
 {
        syslog(LOG_DEBUG, "SMTP: %s\n", __FUNCTION__);
@@ -630,7 +644,6 @@ eReadState SMTP_C_ReadServerStatus(AsyncIO *IO)
        return Finished;
 }
 
-#endif
 CTDL_MODULE_INIT(smtp_eventclient)
 {
        return "smtpeventclient";