Change #271558
| Category | curl |
| Changed by | Stefan Eissing <stefan@eissing.org> |
| Changed at | Thu 18 Jun 2026 10:31:40 |
| Repository | https://github.com/curl/curl.git |
| Project | curl |
| Branch | master |
| Revision | f0be41763542f68dce344beee8a5c5e5b858e6d1 |
Comments
multi: xfers_really_alive Yes, we were counting the "live" transfers before, but were they *really* alive? When determining to add the wakeup socket to fdset/waitfds etc, we should only do that when the multi handle is actually processing transfers. Other wise, the application could wait on the wakeup socket forever. For this, we counted `multi->xfers_alive` (e.g. the "running" number returned by `curl_multi_perform()`). This was almost correct. The problem is that added easy handles are counted as "alive" right away on the addition. But the processing has not started yet. They did not trigger any DNS resolves or opened any sockets yet. Add two fields in multi and easy handle: * `multi->xfers_really_alive`: counts the "alive" transfers that have passed `MSTATE_INIT` (at least once) * `data->state.really_alive`: to track if the transfer has been counted Add test 2412 to check that adding transfers without perform will not trigger the wakeup socket to be added. Fixes #22050 Reported-by: Bryan Henderson Closes #22066
Changed files
- lib/multi.c
- lib/multihandle.h
- lib/urldata.h
- tests/data/Makefile.am
- tests/data/test2412
- tests/libtest/Makefile.inc
- tests/libtest/lib2412.c
- tests/libtest/lib530.c