aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2008-12-03 15:20:27 +0000
committerDaniel Stenberg <daniel@haxx.se>2008-12-03 15:20:27 +0000
commit479ddb1fee2fa5f7204a64742e9dcc2842d668dd (patch)
tree740adc5007ea4c181aef62bcca2c4bca97ab6c5e /lib/multi.c
parent4ee27b4594ab2f326a431d11a014991b712d1927 (diff)
- Igor Novoseltsev filed bug #2351645
(http://curl.haxx.se/bug/view.cgi?id=2351645) that identified a problem with the multi interface that occured if you removed an easy handle while in progress and the handle was used in a HTTP pipeline.
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/multi.c b/lib/multi.c
index b82be6245..ccccf7e8f 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -620,22 +620,27 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
easy->easy_handle->dns.hostcachetype = HCACHE_NONE;
}
- /* 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)) {
+ if(easy->easy_conn) {
+
+ /* 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->data == easy->easy_handle) {
- /* Curl_done() clears the conn->data field to lose the association
- between the easy handle and the connection
+ /* Curl_done() clears the conn->data field to lose the association
+ between the easy handle and the connection
- Note that this ignores the return code simply because there's nothing
- really useful to do with it anyway! */
- (void)Curl_done(&easy->easy_conn, easy->result, premature);
+ Note that this ignores the return code simply because there's
+ nothing really useful to do with it anyway! */
+ (void)Curl_done(&easy->easy_conn, easy->result, premature);
- if(easy->easy_conn)
- /* the connection is still alive, set back the association to enable
- the check below to trigger TRUE */
- easy->easy_conn->data = easy->easy_handle;
+ if(easy->easy_conn)
+ /* the connection is still alive, set back the association to enable
+ the check below to trigger TRUE */
+ easy->easy_conn->data = easy->easy_handle;
+ }
+ else
+ /* Clear connection pipelines, if Curl_done above was not called */
+ Curl_getoff_all_pipelines(easy->easy_handle, easy->easy_conn);
}
/* If this easy_handle was the last one in charge for one or more