]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-connection - Fix race condition between finishing output stream...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 24 Apr 2020 20:26:26 +0000 (22:26 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 27 Apr 2020 17:27:34 +0000 (17:27 +0000)
src/lib-http/http-client-connection.c

index e00a1a1e88e8df1f9e01cd11a835ebfb1ffee845..4ae7db88c2e6563b244c52e2995a6e6ea93cc2a2 100644 (file)
@@ -1118,8 +1118,8 @@ static void http_client_connection_input(struct connection *_conn)
                                "Got unexpected %u response; ignoring",
                                response.status);
                        continue;
-               } else  if (!req->payload_sync &&
-                       req->state == HTTP_REQUEST_STATE_PAYLOAD_OUT) {
+               } else if (!req->payload_sync && !req->payload_finished &&
+                          req->state == HTTP_REQUEST_STATE_PAYLOAD_OUT) {
                        /* got early response from server while we're still
                           sending request payload. we cannot recover from this
                           reliably, so we stop sending payload and close the