]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-server-response - Prevent response content stream from finishing the...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 5 Jul 2018 22:01:14 +0000 (00:01 +0200)
committermartti.rannanjarvi <martti.rannanjarvi@open-xchange.com>
Sat, 18 Apr 2020 14:55:11 +0000 (14:55 +0000)
This is not supposed to happen ever, because the connection output stream needs
to be available for several responses. This was at some point a problem in some
of the test with the new ostream payload API.

src/lib-http/http-server-connection.c
src/lib-http/http-server-response.c

index 10ad174280cc7411a1d1cab59abdf0ffacbcedf0..d1bb19a5a71583d6689abbebc4be1a5b965cf527 100644 (file)
@@ -147,6 +147,7 @@ static void http_server_connection_ready(struct http_server_connection *conn)
        conn->http_parser = http_request_parser_init(
                conn->conn.input, &base_url, &conn->server->set.request_limits,
                HTTP_REQUEST_PARSE_FLAG_STRICT);
+       o_stream_set_finish_via_child(conn->conn.output, FALSE);
        o_stream_set_flush_callback(conn->conn.output,
                                    http_server_connection_output, conn);
 }
index 41baeb8c1cc176620ce3f1e17bdbe9d00369dfe5..b930bc753f011a306808591ce2d554037d68680b 100644 (file)
@@ -601,6 +601,7 @@ static int http_server_response_send_real(struct http_server_response *resp)
                                if (!is_head) {
                                        resp->payload_output =
                                                http_transfer_chunked_ostream_create(conn->conn.output);
+                                       o_stream_set_finish_also_parent(resp->payload_output, FALSE);
                                }
                        }
                } else {