mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
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
This commit is contained in:
parent
c85c2b7be7
commit
5b80b4c012
54 changed files with 1002 additions and 873 deletions
|
|
@ -682,11 +682,12 @@ out:
|
|||
return result;
|
||||
}
|
||||
|
||||
static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
struct easy_pollset *ps)
|
||||
static CURLcode cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf,
|
||||
struct Curl_easy *data,
|
||||
struct easy_pollset *ps)
|
||||
{
|
||||
struct h1_tunnel_state *ts = cf->ctx;
|
||||
CURLcode result = CURLE_OK;
|
||||
|
||||
if(!cf->connected) {
|
||||
/* If we are not connected, but the filter "below" is
|
||||
|
|
@ -698,13 +699,14 @@ static void cf_h1_proxy_adjust_pollset(struct Curl_cfilter *cf,
|
|||
response headers or if we are still sending the request, wait
|
||||
for write. */
|
||||
if(tunnel_want_send(ts))
|
||||
Curl_pollset_set_out_only(data, ps, sock);
|
||||
result = Curl_pollset_set_out_only(data, ps, sock);
|
||||
else
|
||||
Curl_pollset_set_in_only(data, ps, sock);
|
||||
result = Curl_pollset_set_in_only(data, ps, sock);
|
||||
}
|
||||
else
|
||||
Curl_pollset_set_out_only(data, ps, sock);
|
||||
result = Curl_pollset_set_out_only(data, ps, sock);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void cf_h1_proxy_destroy(struct Curl_cfilter *cf,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue