aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2011-02-18 23:19:14 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-02-18 23:19:14 +0100
commitc4369f34b9b493cbed4e7bcafa77614e9d55055d (patch)
tree0b905a8fedb2f7360cae9fbc8c959e05e384e21e
parentd85cae922575d8966529fee364e6d611e3062a99 (diff)
multi: close connection on timeout
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.
-rw-r--r--lib/multi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 31127028d..91d92df90 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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;