mirror of
https://github.com/curl/curl.git
synced 2025-01-24 14:15:18 +08:00
multi: on socket callback error, remove socket hash entry nonetheless
Previously an error from the callback accidentally made libcurl keep the hash entry which would lead to the entry remaining and then potentially getting removed *again* which would lead to internal confusions. This is an old issue (introduced in2b3dd01b77
), caught by the new asserts fromc0233a35da
. Closes #14557
This commit is contained in:
parent
ef1d606d1b
commit
160f023359
11
lib/multi.c
11
lib/multi.c
@ -3013,17 +3013,20 @@ CURLMcode Curl_multi_pollset_ev(struct Curl_multi *multi,
|
||||
if(oldactions & CURL_POLL_IN)
|
||||
entry->readers--;
|
||||
if(!entry->users) {
|
||||
bool dead = FALSE;
|
||||
if(multi->socket_cb) {
|
||||
set_in_callback(multi, TRUE);
|
||||
rc = multi->socket_cb(data, s, CURL_POLL_REMOVE,
|
||||
multi->socket_userp, entry->socketp);
|
||||
set_in_callback(multi, FALSE);
|
||||
if(rc == -1) {
|
||||
multi->dead = TRUE;
|
||||
return CURLM_ABORTED_BY_CALLBACK;
|
||||
}
|
||||
if(rc == -1)
|
||||
dead = TRUE;
|
||||
}
|
||||
sh_delentry(entry, &multi->sockhash, s);
|
||||
if(dead) {
|
||||
multi->dead = TRUE;
|
||||
return CURLM_ABORTED_BY_CALLBACK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* still users, but remove this handle as a user of this socket */
|
||||
|
Loading…
Reference in New Issue
Block a user