find places which access information after the context is not owned anymore
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 27 Oct 2014 20:21:37 +0000 (21:21 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 27 Oct 2014 20:21:37 +0000 (21:21 +0100)
citadel/modules/networkclient/serv_networkclient.c

index 5c38f46ed762f258306ba873c159f11a6a86bf65..41ce83c041a05626a379a269928d939dd0cb8f19 100644 (file)
@@ -200,6 +200,8 @@ eNextState NWC_SendFailureMessage(AsyncIO *IO)
        long lens[2];
        const char *strs[2];
 
+       EVN_syslog(LOG_DEBUG, "NWC: %s\n", __FUNCTION__);
+
        strs[0] = ChrPtr(NW->node);
        lens[0] = StrLength(NW->node);
        
@@ -848,10 +850,9 @@ eNextState NWC_FailNetworkConnection(AsyncIO *IO)
 
 void NWC_SetTimeout(eNextState NextTCPState, AsyncNetworker *NW)
 {
-       AsyncIO *IO = &NW->IO;
        double Timeout = 0.0;
 
-       EVN_syslog(LOG_DEBUG, "%s - %d\n", __FUNCTION__, NextTCPState);
+       //EVN_syslog(LOG_DEBUG, "%s - %d\n", __FUNCTION__, NextTCPState);
 
        switch (NextTCPState) {
        case eSendMore:
@@ -874,6 +875,7 @@ void NWC_SetTimeout(eNextState NextTCPState, AsyncNetworker *NW)
                return;
        }
        if (Timeout > 0) {
+               AsyncIO *IO = &NW->IO;
                EVN_syslog(LOG_DEBUG, 
                           "%s - %d %f\n",
                           __FUNCTION__,
@@ -892,8 +894,11 @@ eNextState NWC_DispatchReadDone(AsyncIO *IO)
 
        rc = NWC_ReadHandlers[NW->State](NW);
 
-       if (rc != eReadMore)
+       if ((rc != eReadMore) &&
+           (rc != eAbort) && 
+           (rc != eDBQuery)) {
                NW->State++;
+       }
 
        NWC_SetTimeout(rc, NW);