From 3b183df9cc781b329ca409ded1ea336530624715 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 5 Jan 2014 16:38:18 +0100 Subject: multi: remove MULTI_TIMEOUT_INACCURACY With the recently added timeout "reminder" functionality, there's no reason left for us to execute timeout code before the time is ripe. Simplifies the handling too. This will make the *TIMEOUT and *CONNECTTIMEOUT options more accurate again, which probably is most important when the *_MS versions are used. In multi_socket, make sure to update 'now' after having handled activity on a socket. --- lib/multi.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'lib/multi.c') diff --git a/lib/multi.c b/lib/multi.c index 3af460da4..cab303049 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -2231,6 +2231,8 @@ static CURLMcode multi_socket(struct Curl_multi *multi, data = NULL; /* set data to NULL again to avoid calling multi_runsingle() in case there's no need to */ + now = Curl_tvnow(); /* get a newer time since the multi_runsingle() loop + may have taken some time */ } } else { @@ -2241,30 +2243,6 @@ static CURLMcode multi_socket(struct Curl_multi *multi, memset(&multi->timer_lastcall, 0, sizeof(multi->timer_lastcall)); } - /* Compensate for bad precision timers that might've triggered too early. - - This precaution was added in commit 2c72732ebf3da5e as a result of bad - resolution in the windows function use(d). - - The problematic case here is when using the multi_socket API and libcurl - has told the application about a timeout, and that timeout is what fires - off a bit early. As we don't have any IDs associated with the timeout we - can't tell which timeout that fired off but we only have the times to use - to check what to do. If it fires off too early, we don't run the correct - actions and we don't tell the application again about the same timeout as - was already first in the queue... - - Originally we made the timeouts run 40 milliseconds early on all systems, - but now we have an #ifdef setup to provide a decent precaution inaccuracy - margin. - */ - - now.tv_usec += MULTI_TIMEOUT_INACCURACY; - if(now.tv_usec >= 1000000) { - now.tv_sec++; - now.tv_usec -= 1000000; - } - /* * The loop following here will go on as long as there are expire-times left * to process in the splay and 'data' will be re-assigned for every expired -- cgit v1.2.3