diff options
author | Stefan Eissing <stefan@eissing.org> | 2023-02-09 16:07:34 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2023-02-21 11:12:48 +0100 |
commit | 821f6e2a89de8aec1c7da3c0f381b92b2b801efc (patch) | |
tree | 9a283ae17112331ca6d76a7d1bdb106ebec6a9cd /lib/url.c | |
parent | d79c3af25940f822b60e00ca8a3d1db03c506d61 (diff) | |
download | curl-821f6e2a89de8aec1c7da3c0f381b92b2b801efc.tar.gz |
CURLOPT_PIPEWAIT: allow waited reuse also for subsequent connections
As tested in test_02_07, when firing off 200 urls with --parallel, 199
wait for the first connection to be established. if that is multiuse,
urls are added up to its capacity.
The first url over capacity opens another connection. But subsequent
urls found the same situation and open a connection too. They should
have waited for the second connection to actually connect and make its
capacity known.
This change fixes that by
- setting `connkeep()` early in the HTTP setup handler. as otherwise
a new connection is marked as closeit by default and not considered
for multiuse at all
- checking the "connected" status for a candidate always and continuing
to PIPEWAIT if no alternative is found.
pytest:
- removed "skip" from test_02_07
- added test_02_07b to check that http/1.1 continues to work as before
Closes #10456
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1170,14 +1170,14 @@ ConnectionExists(struct Curl_easy *data, continue; } } + } - if(!Curl_conn_is_connected(check, FIRSTSOCKET)) { - foundPendingCandidate = TRUE; - /* Don't pick a connection that hasn't connected yet */ - infof(data, "Connection #%ld isn't open enough, can't reuse", - check->connection_id); - continue; - } + if(!Curl_conn_is_connected(check, FIRSTSOCKET)) { + foundPendingCandidate = TRUE; + /* Don't pick a connection that hasn't connected yet */ + infof(data, "Connection #%ld isn't open enough, can't reuse", + check->connection_id); + continue; } #ifdef USE_UNIX_SOCKETS |