summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Crosland <cliftonc@cisco.com>2019-06-11 14:17:30 -0700
committerJay Satiro <raysatiro@yahoo.com>2019-06-12 01:10:22 -0400
commitf67009dd980d370f0518a923ba17947fe452451d (patch)
tree7c690a7171464fe9b59aafd349ee6c0ec04861b0
parent29177f422a55310976378440ffb00ee7d19ce6e9 (diff)
downloadcurl-f67009dd980d370f0518a923ba17947fe452451d.tar.gz
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
-rw-r--r--lib/url.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index c37ce0494..bf1c7c9ea 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -975,7 +975,7 @@ static bool conn_maxage(struct Curl_easy *data,
timediff_t idletime = Curl_timediff(now, conn->lastused);
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",
idletime);
return TRUE;