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 c9c149f8e156fa002493565a05943d27fd2e7233..78876b50271296bb19196de5033537dd70113412 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 e08a39f284b08917421e1d424f466f8551829187..75e1f785ae905ccecb2c34317ea887e7252ff4b3 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: