]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: if Curl_done is premature then pipeline not in use
authorAnders Bakken <agbakken@gmail.com>
Tue, 1 Mar 2016 22:52:38 +0000 (14:52 -0800)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 1 Mar 2016 23:55:04 +0000 (18:55 -0500)
Prevent a crash if 2 (or more) requests are made to the same host and
pipelining is enabled and the connection does not complete.

Bug: https://github.com/curl/curl/pull/690

lib/url.c

index bf293a4d97506f3db3c4c009a4686c0198d94262..9ffca16d1cb1ede900f1de97c3944563cf898859 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -6157,7 +6157,8 @@ CURLcode Curl_done(struct connectdata **connp,
       result = CURLE_ABORTED_BY_CALLBACK;
   }
 
-  if((conn->send_pipe->size + conn->recv_pipe->size != 0 &&
+  if((!premature &&
+      conn->send_pipe->size + conn->recv_pipe->size != 0 &&
       !data->set.reuse_forbid &&
       !conn->bits.close)) {
     /* Stop if pipeline is not empty and we do not have to close