mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
curl_multi_remove_handle: allow multiple removes
When removing an already removed handle, avoid that to ruin the internals and just return OK instead.
This commit is contained in:
parent
2ef83136d4
commit
84f3b3dd44
@ -483,6 +483,10 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
|
|||||||
if(!GOOD_EASY_HANDLE(curl_handle))
|
if(!GOOD_EASY_HANDLE(curl_handle))
|
||||||
return CURLM_BAD_EASY_HANDLE;
|
return CURLM_BAD_EASY_HANDLE;
|
||||||
|
|
||||||
|
/* Prevent users from trying to remove same easy handle more than once */
|
||||||
|
if(!data->multi)
|
||||||
|
return CURLM_OK; /* it is already removed so let's say it is fine! */
|
||||||
|
|
||||||
if(easy) {
|
if(easy) {
|
||||||
bool premature = (data->mstate < CURLM_STATE_COMPLETED) ? TRUE : FALSE;
|
bool premature = (data->mstate < CURLM_STATE_COMPLETED) ? TRUE : FALSE;
|
||||||
bool easy_owns_conn = (data->easy_conn &&
|
bool easy_owns_conn = (data->easy_conn &&
|
||||||
|
Loading…
Reference in New Issue
Block a user