mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 17:31:46 -05:00
url: Fix CURLOPT_MAXAGE_CONN time comparison
Old connections are meant to expire from the connection cache after CURLOPT_MAXAGE_CONN seconds. However, they actually expire after 1000x that value. This occurs because a time value measured in milliseconds is accidentally divided by 1M instead of by 1,000. Closes https://github.com/curl/curl/pull/4013
This commit is contained in:
parent
29177f422a
commit
f67009dd98
@ -975,7 +975,7 @@ static bool conn_maxage(struct Curl_easy *data,
|
|||||||
timediff_t idletime = Curl_timediff(now, conn->lastused);
|
timediff_t idletime = Curl_timediff(now, conn->lastused);
|
||||||
idletime /= 1000; /* integer seconds is fine */
|
idletime /= 1000; /* integer seconds is fine */
|
||||||
|
|
||||||
if(idletime/1000 > data->set.maxage_conn) {
|
if(idletime > data->set.maxage_conn) {
|
||||||
infof(data, "Too old connection (%ld seconds), disconnect it\n",
|
infof(data, "Too old connection (%ld seconds), disconnect it\n",
|
||||||
idletime);
|
idletime);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user