CURL: the cleanup has to be done before.
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 2 Jun 2013 12:10:43 +0000 (14:10 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 2 Jun 2013 12:10:43 +0000 (14:10 +0200)
citadel/event_client.c
citadel/modules/eventclient/serv_eventclient.c

index c9c149f..78876b5 100644 (file)
@@ -403,6 +403,9 @@ void StopCurlWatchers(AsyncIO *IO)
        ev_io_stop(event_base, &IO->send_event);
        ev_io_stop(event_base, &IO->recv_event);
 
+       curl_easy_cleanup(IO->HttpReq.chnd);
+       IO->HttpReq.chnd = NULL;
+
        if (IO->SendBuf.fd != 0) {
                close(IO->SendBuf.fd);
        }
index e08a39f..75e1f78 100644 (file)
@@ -193,9 +193,6 @@ gotstatus(int nnrun)
                        switch(IO->SendDone(IO))
                        {
                        case eDBQuery:
-                               curl_easy_cleanup(IO->HttpReq.chnd);
-                               IO->HttpReq.chnd = NULL;
-                               break;
                        case eSendDNSQuery:
                        case eReadDNSReply:
                        case eConnect:
@@ -206,8 +203,6 @@ gotstatus(int nnrun)
                        case eReadMore:
                        case eReadPayload:
                        case eReadFile:
-                               curl_easy_cleanup(IO->HttpReq.chnd);
-                               IO->HttpReq.chnd = NULL;
                                break;
                        case eTerminateConnection:
                        case eAbort: