]> granicus.if.org Git - curl/commitdiff
url: skip to-be-closed connections when pipelining
authorRider Linden <rider@lindenlab.com>
Fri, 19 Feb 2016 19:18:33 +0000 (11:18 -0800)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 14 Oct 2016 07:16:46 +0000 (03:16 -0400)
No longer attempt to use "doomed" to-be-closed connections when
pipelining. Prior to this change connections marked for deletion (e.g.
timeout) would be erroneously used, resulting in sporadic crashes.

As originally reported and fixed by Carlo Wood (origin unknown).

Bug: https://github.com/curl/curl/issues/627
Reported-by: Rider Linden
Closes https://github.com/curl/curl/pull/1075
Participation-by: nopjmp@users.noreply.github.com
lib/url.c

index 74e9bf5c622d45214cf887065dab3fd489e051bc..5e1a0c32fa0b07dc5154285aa851865b427c6117 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2908,7 +2908,7 @@ static bool IsPipeliningPossible(const struct Curl_easy *handle,
                                  const struct connectdata *conn)
 {
   /* If a HTTP protocol and pipelining is enabled */
-  if(conn->handler->protocol & PROTO_FAMILY_HTTP) {
+  if((conn->handler->protocol & PROTO_FAMILY_HTTP) && !conn->bits.close) {
 
     if(Curl_pipeline_wanted(handle->multi, CURLPIPE_HTTP1) &&
        (handle->set.httpversion != CURL_HTTP_VERSION_1_0) &&
@@ -3283,6 +3283,8 @@ ConnectionExists(struct Curl_easy *data,
       pipeLen = check->send_pipe->size + check->recv_pipe->size;
 
       if(canPipeline) {
+        if(check->bits.close)
+            continue;
 
         if(!check->bits.multiplex) {
           /* If not multiplexing, make sure the pipe has only GET requests */