aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-09-28 23:17:34 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-09-28 23:49:32 +0200
commited4eecc05e0cce36d8ce4ac9466376ca5fcfcba2 (patch)
treea21203361f11635b72f965d7d2f2d6a6892ecfe5 /lib
parent7e1a45e224e574d32d255b915917ed3cb3390d4b (diff)
multi: don't expire timeouts at disonnect or done
The functions Curl_disconnect() and Curl_done() are both used within the scope of a single request so they cannot be allowed to use Curl_expire(... 0) to kill all timeouts as there are some timeouts that are set before a request that are supposed to remain until the request is done. The timeouts are now instead cleared at curl_easy_cleanup() and when the multi state machine changes a handle to the complete state.
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c2
-rw-r--r--lib/url.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c
index e857392e0..875e136ee 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1594,6 +1594,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
/* Important: reset the conn pointer so that we don't point to memory
that could be freed anytime */
easy->easy_conn = NULL;
+
+ Curl_expire(data, 0); /* stop all timers */
break;
case CURLM_STATE_MSGSENT:
diff --git a/lib/url.c b/lib/url.c
index 7fe713d3e..1b65a923f 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -481,6 +481,8 @@ CURLcode Curl_close(struct SessionHandle *data)
}
#endif
+ Curl_expire(data, 0); /* shut off timers */
+
if(m)
/* This handle is still part of a multi handle, take care of this first
and detach this handle from there. */
@@ -2579,7 +2581,6 @@ CURLcode Curl_disconnect(struct connectdata *conn)
NULL, Curl_scan_cache_used);
#endif
- Curl_expire(data, 0); /* shut off timers */
Curl_hostcache_prune(data); /* kill old DNS cache entries */
{
@@ -5131,8 +5132,6 @@ CURLcode Curl_done(struct connectdata **connp,
conn = *connp;
data = conn->data;
- Curl_expire(data, 0); /* stop timer */
-
if(conn->bits.done)
/* Stop if Curl_done() has already been called */
return CURLE_OK;