From 5d543fe90670c1924fd2c7d6be871b3ad90c438d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 25 Oct 2017 11:59:43 +0200 Subject: time: rename Curl_tvnow to Curl_now ... since the 'tv' stood for timeval and this function does not return a timeval struct anymore. Also, cleaned up the Curl_timediff*() functions to avoid typecasts and clean up the descriptive comments. Closes #2011 --- lib/pingpong.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/pingpong.c') diff --git a/lib/pingpong.c b/lib/pingpong.c index 278405f72..438856a99 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -61,12 +61,12 @@ time_t Curl_pp_state_timeout(struct pingpong *pp) /* Without a requested timeout, we only wait 'response_time' seconds for the full response to arrive before we bail out */ timeout_ms = response_time - - Curl_timediff(Curl_tvnow(), pp->response); /* spent time */ + Curl_timediff(Curl_now(), pp->response); /* spent time */ if(data->set.timeout) { /* if timeout is requested, find out how much remaining time we have */ timeout2_ms = data->set.timeout - /* timeout time */ - Curl_timediff(Curl_tvnow(), conn->now); /* spent time */ + Curl_timediff(Curl_now(), conn->now); /* spent time */ /* pick the lowest number */ timeout_ms = CURLMIN(timeout_ms, timeout2_ms); @@ -120,7 +120,7 @@ CURLcode Curl_pp_statemach(struct pingpong *pp, bool block) if(Curl_pgrsUpdate(conn)) result = CURLE_ABORTED_BY_CALLBACK; else - result = Curl_speedcheck(data, Curl_tvnow()); + result = Curl_speedcheck(data, Curl_now()); if(result) return result; @@ -143,7 +143,7 @@ void Curl_pp_init(struct pingpong *pp) pp->nread_resp = 0; pp->linestart_resp = conn->data->state.buffer; pp->pending_resp = TRUE; - pp->response = Curl_tvnow(); /* start response time-out now! */ + pp->response = Curl_now(); /* start response time-out now! */ } @@ -235,7 +235,7 @@ CURLcode Curl_pp_vsendf(struct pingpong *pp, free(s); pp->sendthis = NULL; pp->sendleft = pp->sendsize = 0; - pp->response = Curl_tvnow(); + pp->response = Curl_now(); } return CURLE_OK; @@ -499,7 +499,7 @@ CURLcode Curl_pp_flushsend(struct pingpong *pp) free(pp->sendthis); pp->sendthis = NULL; pp->sendleft = pp->sendsize = 0; - pp->response = Curl_tvnow(); + pp->response = Curl_now(); } return CURLE_OK; } -- cgit v1.2.1