mirror of
https://github.com/curl/curl.git
synced 2026-08-25 18:23:44 +03:00
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
This commit is contained in:
parent
d79c3af259
commit
821f6e2a89
3 changed files with 33 additions and 16 deletions
14
lib/url.c
14
lib/url.c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue