mirror of
https://github.com/curl/curl.git
synced 2026-08-26 01:33:33 +03:00
cpool/cshutdown: force close connections under pressure
when CURLMOPT_MAX_HOST_CONNECTIONS or CURLMOPT_MAX_TOTAL_CONNECTIONS limits are reached, force close connections in shutdown to go below limit when possible. Fixes #17020 Reported-by: Fujii Hironori Closes #17022
This commit is contained in:
parent
9f8bdd0eae
commit
ff37657e4d
5 changed files with 108 additions and 34 deletions
|
|
@ -3597,10 +3597,12 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|||
conn->bits.tls_enable_alpn = TRUE;
|
||||
}
|
||||
|
||||
if(waitpipe)
|
||||
if(waitpipe) {
|
||||
/* There is a connection that *might* become usable for multiplexing
|
||||
"soon", and we wait for that */
|
||||
infof(data, "Waiting on connection to negotiate possible multiplexing.");
|
||||
connections_available = FALSE;
|
||||
}
|
||||
else {
|
||||
switch(Curl_cpool_check_limits(data, conn)) {
|
||||
case CPOOL_LIMIT_DEST:
|
||||
|
|
@ -3614,7 +3616,8 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|||
else
|
||||
#endif
|
||||
{
|
||||
infof(data, "No connections available in cache");
|
||||
infof(data, "No connections available, total of %ld reached.",
|
||||
data->multi->max_total_connections);
|
||||
connections_available = FALSE;
|
||||
}
|
||||
break;
|
||||
|
|
@ -3624,8 +3627,6 @@ static CURLcode create_conn(struct Curl_easy *data,
|
|||
}
|
||||
|
||||
if(!connections_available) {
|
||||
infof(data, "No connections available.");
|
||||
|
||||
Curl_conn_free(data, conn);
|
||||
*in_connect = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue