]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Fixed assert crash occurring when DNS lookup fails immediately...
authorStephan Bosch <stephan@rename-it.nl>
Thu, 9 Oct 2014 21:46:15 +0000 (00:46 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Thu, 9 Oct 2014 21:46:15 +0000 (00:46 +0300)
In that situation, the request was not dropped from the queue immediately, triggering the assert crash.

src/lib-http/http-client-request.c

index f33a445a224f90f953848dcd01cbe107831bd383..e59bbecdf5291de4a291f607e700277399c6952a 100644 (file)
@@ -900,6 +900,9 @@ void http_client_request_error(struct http_client_request *req,
        if (req->state >= HTTP_REQUEST_STATE_FINISHED)
                return;
 
+       if (req->queue != NULL)
+               http_client_queue_drop_request(req->queue, req);
+
        if (!req->submitted) {
                /* we're still in http_client_request_submit(). delay
                   reporting the error, so the caller doesn't have to handle
@@ -910,8 +913,6 @@ void http_client_request_error(struct http_client_request *req,
                http_client_host_delay_request_error(req->host, req);
        } else {
                http_client_request_send_error(req, status, error);
-               if (req->queue != NULL)
-                       http_client_queue_drop_request(req->queue, req);
                http_client_request_unref(&req);
        }
 }