]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: server: Fixed assert failure occurring when closing the connection while...
authorStephan Bosch <stephan@rename-it.nl>
Sat, 30 Apr 2016 12:22:21 +0000 (14:22 +0200)
committerGitLab <gitlab@git.dovecot.net>
Sat, 30 Apr 2016 12:26:09 +0000 (15:26 +0300)
src/lib-http/http-server-connection.c

index 6e166817e3ac03da611c5612d7aa1e25725db77d..ce0ee5be6416bde1733e6cfb7dd8e8257ddc4bc3 100644 (file)
@@ -1092,6 +1092,13 @@ http_server_connection_disconnect(struct http_server_connection *conn,
        /* preserve statistics */
        http_server_connection_update_stats(conn);
 
+       if (conn->incoming_payload != NULL) {
+               /* the stream is still accessed by lib-http caller. */
+               i_stream_remove_destroy_callback(conn->incoming_payload,
+                                                http_server_payload_destroyed);
+               conn->incoming_payload = NULL;
+       }
+
        /* drop all requests before connection is closed */
        req = conn->request_queue_head;
        while (req != NULL) {
@@ -1111,13 +1118,6 @@ http_server_connection_disconnect(struct http_server_connection *conn,
                o_stream_uncork(conn->conn.output);
        }
 
-       if (conn->incoming_payload != NULL) {
-               /* the stream is still accessed by lib-http caller. */
-               i_stream_remove_destroy_callback(conn->incoming_payload,
-                                                http_server_payload_destroyed);
-               conn->incoming_payload = NULL;
-       }
-
        if (conn->http_parser != NULL)
                http_request_parser_deinit(&conn->http_parser);
        connection_disconnect(&conn->conn);