diff options
author | ejanchivdorj <ejanchivdorj@tableau.com> | 2021-03-09 13:23:43 -0800 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-03-10 14:05:02 +0100 |
commit | a2bbc3ac8c5498a42a50d831cb59078e05f3f1d7 (patch) | |
tree | df810c08022a49f66a3bbe65f0bf3e008cbe1d66 | |
parent | 4088b25b337d67fa34e96e90cf98dd3865ce2d33 (diff) | |
download | curl-a2bbc3ac8c5498a42a50d831cb59078e05f3f1d7.tar.gz |
multi: update pending list when removing handle
when removing a handle, most of the lists are updated but pending list
is not updated. Updating now.
Closes #6713
-rw-r--r-- | lib/multi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c index d3b670c31..f5bacc17c 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -824,6 +824,17 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, } } + /* Remove from the pending list if it is there. Otherwise this will + remain on the pending list forever due to the state change. */ + for(e = multi->pending.head; e; e = e->next) { + struct Curl_easy *curr_data = e->ptr; + + if(curr_data == data) { + Curl_llist_remove(&multi->pending, e, NULL); + break; + } + } + /* make the previous node point to our next */ if(data->prev) data->prev->next = data->next; @@ -840,6 +851,8 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi, We do not touch the easy handle here! */ multi->num_easy--; /* one less to care about now */ + process_pending_handles(multi); + Curl_update_timer(multi); return CURLM_OK; } |