From: Stephan Bosch Date: Sat, 17 Feb 2018 00:25:50 +0000 (+0100) Subject: lib-http: client: Flush and check output for errors after uncorking. X-Git-Tag: 2.3.9~2268 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0753b82010b1ae517d3cec8988a2cffcfbc0dc5b;p=thirdparty%2Fdovecot%2Fcore.git lib-http: client: Flush and check output for errors after uncorking. Otherwise, a disconnection event may be missed. --- diff --git a/src/lib-http/http-client-request.c b/src/lib-http/http-client-request.c index d6dca2d89d..a1497b7c60 100644 --- a/src/lib-http/http-client-request.c +++ b/src/lib-http/http-client-request.c @@ -1284,14 +1284,14 @@ static int http_client_request_send_real(struct http_client_request *req, http_client_connection_start_request_timeout(req->conn); conn->output_locked = FALSE; } - if (ret >= 0 && o_stream_flush(output) < 0) { - *error_r = t_strdup_printf("flush(%s) failed: %s", - o_stream_get_name(output), - o_stream_get_error(output)); - ret = -1; - } } - o_stream_uncork(output); + if (ret >= 0 && o_stream_uncork_flush(output) < 0) { + *error_r = t_strdup_printf("flush(%s) failed: %s", + o_stream_get_name(output), + o_stream_get_error(output)); + ret = -1; + } + return ret; }