]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Clear req->conn when request is finished.
authorStephan Bosch <stephan@rename-it.nl>
Thu, 23 Oct 2014 02:55:51 +0000 (05:55 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Thu, 23 Oct 2014 02:55:51 +0000 (05:55 +0300)
This prevents a spurious assert failure.

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

index 764de62ca9b9f148682f5e6aab963d8daec79444..7d456ae98352283cc180d4f94ca2301bbfa48c5e 100644 (file)
@@ -438,6 +438,7 @@ static void http_client_payload_destroyed(struct http_client_request *req)
           the payload. make sure here that it's switched back. */
        net_set_nonblock(conn->conn.fd_in, TRUE);
 
+       req->conn = NULL;
        conn->incoming_payload = NULL;
        conn->pending_request = NULL;
        http_client_request_finish(&req);
@@ -495,6 +496,7 @@ http_client_connection_return_response(struct http_client_connection *conn,
        retrying = !http_client_request_callback(req, response);
        http_client_connection_unref(&conn);
        if (conn == NULL) {
+               req->conn = NULL;
                /* the callback managed to get this connection destroyed */
                if (!retrying)
                        http_client_request_finish(&req);
@@ -531,6 +533,7 @@ http_client_connection_return_response(struct http_client_connection *conn,
                        http_client_payload_finished(conn);
                }
        } else {
+               req->conn = NULL;
                http_client_request_finish(&req);
                http_client_request_unref(&req);
        }