]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: client: Uncork and flush the output stream explicitly after continuing...
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 17 Feb 2018 11:03:41 +0000 (12:03 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 17 Feb 2018 14:49:41 +0000 (15:49 +0100)
This allows detecting any output stream errors.

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

index dade47e57578081147d449db434e8d20b47b7bef..b2c21d5b7cb9b8695bb4d66a61418e518f3275c2 100644 (file)
@@ -1221,12 +1221,20 @@ http_client_connection_continue_request(struct http_client_connection *conn)
        if (req->payload_sync && !req->payload_sync_continue)
                return 0;
 
+       o_stream_cork(conn->conn.output);
+
        tmp_conn = conn;
        http_client_connection_ref(tmp_conn);
        ret = http_client_request_send_more(req, pipelined);
        if (!http_client_connection_unref(&tmp_conn) || ret < 0)
                return -1;
 
+       if (conn->conn.output != NULL &&
+           o_stream_uncork_flush(conn->conn.output) < 0) {
+               http_client_connection_handle_output_error(conn);
+               return -1;
+       }
+
        if (!conn->output_locked) {
                /* room for new requests */
                if (http_client_connection_check_ready(conn) > 0)