- don't use logfunctions that access the non-owned IO anymore
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 27 Oct 2014 20:19:27 +0000 (21:19 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Mon, 27 Oct 2014 20:19:27 +0000 (21:19 +0100)
 - move stopping of c-ares from free to stop client watchers

citadel/event_client.c

index b3b52e68894dd9f3319d9a67e15e1ebfa0aa4f2e..120519e7e12356b999249ecf92c29dc498807a8e 100644 (file)
@@ -122,7 +122,7 @@ eNextState QueueDBOperation(AsyncIO *IO, IO_CallBack CB)
        ev_async_send (event_db, &DBAddJob);
        pthread_mutex_unlock(&DBEventExitQueueMutex);
 
-       EVM_syslog(LOG_DEBUG, "DBEVENT Q Done.\n");
+       EVQM_syslog(LOG_DEBUG, "DBEVENT Q Done.\n");
        return eDBQuery;
 }
 
@@ -314,7 +314,6 @@ eNextState CurlQueueDBOperation(AsyncIO *IO, IO_CallBack CB)
 }
 
 
-void DestructCAres(AsyncIO *IO);
 void FreeAsyncIOContents(AsyncIO *IO)
 {
        CitContext *Ctx = IO->CitContext;
@@ -323,8 +322,6 @@ void FreeAsyncIOContents(AsyncIO *IO)
        FreeStrBuf(&IO->SendBuf.Buf);
        FreeStrBuf(&IO->RecvBuf.Buf);
 
-       DestructCAres(IO);
-
        FreeURL(&IO->ConnectMe);
        FreeStrBuf(&IO->HttpReq.ReplyData);
 
@@ -336,10 +333,13 @@ void FreeAsyncIOContents(AsyncIO *IO)
 }
 
 
+void DestructCAres(AsyncIO *IO);
 void StopClientWatchers(AsyncIO *IO, int CloseFD)
 {
        EVM_syslog(LOG_DEBUG, "EVENT StopClientWatchers");
        
+       DestructCAres(IO);
+
        ev_timer_stop (event_base, &IO->rw_timeout);
        ev_timer_stop(event_base, &IO->conn_fail);
        ev_idle_stop(event_base, &IO->unwind_stack);