Use a single function to transition from IO to DB Queue
authorWilfried Goesgens <dothebart@citadel.org>
Thu, 23 Oct 2014 19:03:09 +0000 (21:03 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Thu, 23 Oct 2014 19:03:09 +0000 (21:03 +0200)
citadel/event_client.c
citadel/event_client.h
citadel/modules/networkclient/serv_networkclient.c
citadel/modules/smtp/serv_smtpeventclient.c

index d64e95bacc6da8b6ad648a931d3a9931c1fad697..b3b52e68894dd9f3319d9a67e15e1ebfa0aa4f2e 100644 (file)
@@ -257,9 +257,9 @@ eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB)
        return eSendReply;
 }
 
-eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB)
+eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB, int CloseFDs)
 {
-       StopClientWatchers(IO, 0);
+       StopClientWatchers(IO, CloseFDs);
        return QueueDBOperation(IO, CB);
 }
 eNextState DBQueueEventContext(AsyncIO *IO, IO_CallBack CB)
index a5e0c326f5e0b08a401b4020a5605eeda04bbc22..8777a34333d9509c2a30f7a134d1c30fb3530ff2 100644 (file)
@@ -283,7 +283,7 @@ void FreeAsyncIOContents(AsyncIO *IO);
 
 eNextState NextDBOperation(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB);
-eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB);
+eNextState EventQueueDBOperation(AsyncIO *IO, IO_CallBack CB, int CloseFDs);
 void StopDBWatchers(AsyncIO *IO);
 eNextState QueueEventContext(AsyncIO *IO, IO_CallBack CB);
 eNextState QueueCurlContext(AsyncIO *IO);
index 95badfb6854383974c3d9478ce20b5d2602105e7..72f48367ca7869a21f2a7239802e689fb4667a7a 100644 (file)
@@ -242,8 +242,8 @@ eNextState NWC_ReadGreeting(AsyncNetworker *NW)
                             "Connected to node \"%s\" but I was expecting to connect to node \"%s\".",
                             connected_to, ChrPtr(NW->node));
                EVN_syslog(LOG_ERR, "%s\n", ChrPtr(NW->IO.ErrMsg));
-               StopClientWatchers(IO, 1);
-               return QueueDBOperation(IO, NWC_SendFailureMessage);
+
+               return EventQueueDBOperation(IO, NWC_SendFailureMessage, 1);
        }
        return eSendReply;
 }
index 3874bf8f47d57de55e818d95a431ab58df4572cb..a9317105dc123053b0d101fbe577e8a0755e7b8e 100644 (file)
@@ -255,7 +255,7 @@ eNextState Terminate(AsyncIO *IO)
 eNextState FinalizeMessageSend(SmtpOutMsg *Msg)
 {
        /* hand over to DB Queue */
-       return EventQueueDBOperation(&Msg->IO, FinalizeMessageSend_DB);
+       return EventQueueDBOperation(&Msg->IO, FinalizeMessageSend_DB, 0);
 }
 
 eNextState FailOneAttempt(AsyncIO *IO)