]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client: Fixed segfault caused by earlier improvement of connection...
authorStephan Bosch <stephan@rename-it.nl>
Sun, 15 Sep 2013 22:02:03 +0000 (01:02 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Sun, 15 Sep 2013 22:02:03 +0000 (01:02 +0300)
Segfault was triggered when an aborted request received a response.

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

index 7a17b7ef7ec8ba81b76e1e407753be2c2e41dc98..4e2ca693683e5ae325391060b3c5764999f678cf 100644 (file)
@@ -575,6 +575,10 @@ static void http_client_connection_input(struct connection *_conn)
                        "Got %u response for request %s",
                        response.status, http_client_request_label(req));
 
+               /* make sure connection output is unlocked if 100-continue failed */
+               if (req->payload_sync && !conn->payload_continue)
+                       conn->output_locked = FALSE;    
+
                /* remove request from queue */
                array_delete(&conn->request_wait_list, 0, 1);
                aborted = (req->state == HTTP_REQUEST_STATE_ABORTED);
@@ -582,8 +586,6 @@ static void http_client_connection_input(struct connection *_conn)
                http_client_request_unref(&req);
                
                conn->close_indicated = response.connection_close;
-               if (req->payload_sync && !conn->payload_continue)
-                       conn->output_locked = FALSE;    
 
                if (!aborted) {
                        if (response.status == 417 && req->payload_sync) {