]> git.ipfire.org Git - thirdparty/curl.git/commit
lib: replace `getsock()` logic with pollsets
authorStefan Eissing <stefan@eissing.org>
Mon, 4 Aug 2025 14:17:37 +0000 (16:17 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 4 Aug 2025 21:43:13 +0000 (23:43 +0200)
commit5b80b4c0121b69e9a9209d6734098181356b3d23
tree72fe55072d3dd8f299941efcc77f9bcb1b871b8b
parentc85c2b7be7c3786b172d4f619bfeb5e0e90980fb
lib: replace `getsock()` logic with pollsets

`getsock()` calls operated on a global limit that could
not be configure beyond 16 sockets. This is no longer adequate
with the new happy eyeballing strategy.

Instead, do the following:
- make `struct easy_pollset` dynamic. Starting with
  a minimal room for two sockets, the very common case,
  allow it to grow on demand.
- replace all protocol handler getsock() calls with pollsets
  and a CURLcode to return failures
- add CURLcode return for all connection filter `adjust_pollset()`
  callbacks, since they too can now fail.
- use appropriately in multi.c and multi_ev.c
- fix unit2600 to trigger pollset growth

Closes #18164
54 files changed:
lib/asyn-ares.c
lib/asyn-base.c
lib/asyn-thrdd.c
lib/asyn.h
lib/cf-h1-proxy.c
lib/cf-h2-proxy.c
lib/cf-haproxy.c
lib/cf-https-connect.c
lib/cf-ip-happy.c
lib/cf-socket.c
lib/cfilters.c
lib/cfilters.h
lib/cshutdn.c
lib/curl_rtmp.c
lib/dict.c
lib/file.c
lib/ftp.c
lib/gopher.c
lib/hostip.c
lib/hostip.h
lib/http.c
lib/http.h
lib/http2.c
lib/imap.c
lib/ldap.c
lib/mqtt.c
lib/multi.c
lib/multi_ev.c
lib/multihandle.h
lib/multiif.h
lib/openldap.c
lib/pingpong.c
lib/pingpong.h
lib/pop3.c
lib/rtsp.c
lib/select.c
lib/select.h
lib/smb.c
lib/smtp.c
lib/socks.c
lib/telnet.c
lib/tftp.c
lib/transfer.h
lib/urldata.h
lib/vquic/curl_ngtcp2.c
lib/vquic/curl_osslq.c
lib/vquic/curl_quiche.c
lib/vssh/libssh.c
lib/vssh/libssh2.c
lib/vssh/wolfssh.c
lib/vtls/vtls.c
lib/vtls/vtls_int.h
lib/ws.c
tests/unit/unit2600.c