diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-02-18 23:02:42 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-02-18 23:02:42 +0000 |
commit | cbf58d88d0a84042d9dd8a7a6b1644f15242cf02 (patch) | |
tree | d20bcd5dc3bf9312c48832d182adbfc029e8792e /lib/multi.c | |
parent | 300cbc2e214c6af0a122fc13d2132642f21df8db (diff) |
- Jeff Pohlmeyer identified two problems: first a rather obscure problem with
the multi interface and connection re-use that could make a
curl_multi_remove_handle() ruin a pointer in another handle.
The second problem was less of an actual problem but more of minor quirk:
the re-using of connections wasn't properly checking if the connection was
marked for closure.
Diffstat (limited to 'lib/multi.c')
-rw-r--r-- | lib/multi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/multi.c b/lib/multi.c index d32172288..49db7d064 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -542,11 +542,10 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle, easy->easy_handle->dns.hostcachetype = HCACHE_NONE; } - /* if we have a connection we must call Curl_done() here so that we - don't leave a half-baked one around */ - if(easy->easy_conn) { - /* Set up the association right */ - easy->easy_conn->data = easy->easy_handle; + /* we must call Curl_done() here (if we still "own it") so that we don't + leave a half-baked one around */ + if(easy->easy_conn && + (easy->easy_conn->data == easy->easy_handle)) { /* Curl_done() clears the conn->data field to lose the association between the easy handle and the connection */ |