mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:33:31 +03:00
urldata: make maxconnects a 32 bit value
"2^32 idle connections ought to be enough for anybody" Closes #12375
This commit is contained in:
parent
14612e5fbe
commit
2d06eebf28
6 changed files with 20 additions and 25 deletions
|
|
@ -379,15 +379,12 @@ conncache_find_first_connection(struct conncache *connc)
|
|||
bool Curl_conncache_return_conn(struct Curl_easy *data,
|
||||
struct connectdata *conn)
|
||||
{
|
||||
/* data->multi->maxconnects can be negative, deal with it. */
|
||||
size_t maxconnects =
|
||||
(data->multi->maxconnects < 0) ? data->multi->num_easy * 4:
|
||||
data->multi->maxconnects;
|
||||
unsigned int maxconnects = !data->multi->maxconnects ?
|
||||
data->multi->num_easy * 4: data->multi->maxconnects;
|
||||
struct connectdata *conn_candidate = NULL;
|
||||
|
||||
conn->lastused = Curl_now(); /* it was used up until now */
|
||||
if(maxconnects > 0 &&
|
||||
Curl_conncache_size(data) > maxconnects) {
|
||||
if(maxconnects && Curl_conncache_size(data) > maxconnects) {
|
||||
infof(data, "Connection cache is full, closing the oldest one");
|
||||
|
||||
conn_candidate = Curl_conncache_extract_oldest(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue