mirror of
https://github.com/curl/curl.git
synced 2026-08-26 04:13:31 +03:00
multi: improve wakeup and wait code
- Split WINSOCK and POSIX code in `multi_wait()` as the ifdef'ery was becoming unreadable - define `ENABLE_WAKEUP` to mean the wakeup socketpair is enabled, no additional USE_WINSOCK check needed. Under WINSOCK `ENABLE_WAKEUP` is not defined, so it's availability is as before under the double defined() checks - When the multi handle has "alive" transfers, the admin handle's pollset include the wakeup receive socket. This results in the admin handle running when someone uses `curl_multi_wakeup()`. - Without any "alive" transfers, the wakeup socket is removed from the pollset. Otherwise, event based processing would never finish, eg. leave the event loop. - The wakeup socket was never registered for event processing before, e.g. `curl_multi_wakeup()` never worked in that mode. - Adjust test exepectations on socket callback invocations and number of sockets appearing in waitfds sets. Closes #20832
This commit is contained in:
parent
447b32f13a
commit
9bc8b078eb
7 changed files with 328 additions and 240 deletions
|
|
@ -603,10 +603,8 @@ void Curl_multi_ev_xfer_done(struct Curl_multi *multi,
|
|||
struct Curl_easy *data)
|
||||
{
|
||||
DEBUGASSERT(!data->conn); /* transfer should have been detached */
|
||||
if(data != multi->admin) {
|
||||
(void)mev_assess(multi, data, NULL);
|
||||
Curl_meta_remove(data, CURL_META_MEV_POLLSET);
|
||||
}
|
||||
(void)mev_assess(multi, data, NULL);
|
||||
Curl_meta_remove(data, CURL_META_MEV_POLLSET);
|
||||
}
|
||||
|
||||
void Curl_multi_ev_conn_done(struct Curl_multi *multi,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue