diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-17 09:16:57 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-17 16:41:56 +0200 |
commit | 57166cf898fb46830448778f47c825c876a263f1 (patch) | |
tree | ed2043de6b522e0206394c70c24993b113017dd7 /lib/smtp.c | |
parent | 8bc25c590e530de87595d1bb3577f699eb1309b9 (diff) | |
download | curl-57166cf898fb46830448778f47c825c876a263f1.tar.gz |
time: reduce calls to Curl_now()
Curl_now() returns the current time with microsecond accuracy - but
should not be used superfluously.
Instead use Curl_mnow(), which is a cached "reasonably updated" current
time. To force a time refresh, use Curl_now_update(). Each API entry
point should force a time refresh, as well as after any potential waits
or delays.
As an extra debug-helper: debug builds will get a check in Curl_mnow()
that compares the "cached" time with the Curl_now() time and warns on
stderr if the delta is 5000 microseconds or more. It also keeps the
source name + line number of the most recent update to aid.
Fixes #5574
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index ec936480e..3f68c9d19 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1412,7 +1412,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status, } else { /* Successfully sent so adjust the response timeout relative to now */ - pp->response = Curl_now(); + pp->response = Curl_mnow(data->multi); free(eob); } |