]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-request - Prevent request content stream from finishing the...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 5 Jul 2018 21:52:51 +0000 (23:52 +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 requests. This was at some point a problem in some
of the test with the new ostream payload API.

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

index f0f1c66fdc435bf9770310a5b993f53458de64c1..176aff69119f4f223160a53d4507bb635ac57062 100644 (file)
@@ -1434,6 +1434,7 @@ http_client_connection_ready(struct http_client_connection *conn)
        /* start protocol I/O */
        conn->http_parser = http_response_parser_init
                (conn->conn.input, &set->response_hdr_limits, 0);
+       o_stream_set_finish_via_child(conn->conn.output, FALSE);
        o_stream_set_flush_callback(conn->conn.output,
     http_client_connection_output, conn);
 }
index 0ea0a08ab5b9220c2690ea0c9dcb6c0d4e749126..7760a90a7ed25d8b4217239ae81baf94215deb2f 100644 (file)
@@ -1329,6 +1329,7 @@ static int http_client_request_send_real(struct http_client_request *req,
                        str_append(rtext, "Transfer-Encoding: chunked\r\n");
                req->payload_output =
                        http_transfer_chunked_ostream_create(conn->conn.output);
+               o_stream_set_finish_also_parent(req->payload_output, FALSE);
        } else if (req->payload_input != NULL ||
                req->payload_empty ||
                strcasecmp(req->method, "POST") == 0 ||