]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: close connection on timeout
authorMike Crowe <mac@mcrowe.com>
Fri, 18 Feb 2011 22:19:14 +0000 (23:19 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Feb 2011 22:19:14 +0000 (23:19 +0100)
After a request times out, the connection wasn't properly closed and
prevented to get re-used, so subsequent transfers could still mistakenly
get to use the previously aborted connection.

lib/multi.c

index 31127028dd6790b10c4d95e316b6458ec2323f21..91d92df90ba7f9d5b3534dd2a5ac3d74ff4f8d4f 100644 (file)
@@ -1003,6 +1003,11 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
                 Curl_tvdiff(now, data->progress.t_startsingle), k->bytecount,
                 k->size);
         }
+
+        /* Force the connection closed because the server could continue to
+           send us stuff at any time. (The disconnect_conn logic used below
+           doesn't work at this point). */
+        easy->easy_conn->bits.close = TRUE;
         easy->result = CURLE_OPERATION_TIMEDOUT;
         multistate(easy, CURLM_STATE_COMPLETED);
         break;