cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1244 multi handle process more than one easy handle, timeout control error

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Tue, 11 Jun 2013 09:01:38 +0000

- **status**: pending --> closed-duplicate

---
** [bugs:#1244] multi handle process more than one easy handle, timeout control error**
**Status:** closed-duplicate
**Created:** Sat Jun 08, 2013 08:42 AM UTC by he qin
**Last Updated:** Sun Jun 09, 2013 09:28 PM UTC
**Owner:** Daniel Stenberg
hi
in curl-7.30.0,  if I add two easy handle to one multi, and  I set timeout(80ms) to all the two easy handle, such as:
curl_multi_add_handle(multi, c1);
curl_multi_add_handle(multi, c2);
If c1 returns the result after 50ms and c2 returns the result after 60ms, actually both of them are CURLE_OK, but I got the result is : c1 CURLE_OK, c2 CURLE_OPERATION_TIMEDOUT
read the code, I use curl_multi_socket_action function which call multi_socket.  in multi_socket function, it has a logic as:
now = Curl_tvnow();
Curl_hash_pick---get one easy handle
multi_runsingle---call for the easy handle
now += 40ms
Curl_splaygetbest()----get another easy handle
multi_runsingle() --- call for this easy handle
In my example, like this:(suppose add two easy handles at 2013-06-08 16:32:10.015, set timeout 80ms, so, the timeout at 2013-06-08 16:32:10.095)
now = 2013-06-08 16:32:10.065 (c1 return after 50ms)
Curl_hash_pick ---- c1
multi_runsingle --- c1 ok
now += 40ms (now is 2013-06-08 16:32:10.105)
Curl_splaygetbest() ---- get c2
multi_runsingle() --- call for c2, in this function, will check timeout, diff now and  2013-06-08 16:32:10.095. so, libcurl considers the c2 is timeout.
I think in multi_runsingle function,  should diff (real now) not (now in args which add by 40ms outside)
I see the bug #1228,    https://sourceforge.net/p/curl/bugs/1228/
Daniel Stenberg said:
"I can agree to adding ifdef logic to lower the threshold for systems we think are likely to work, like Linux, but I don't think we should aim for perfect millisecond precision."
As mentioned above, should I believe  the CURLOPT_TIMEOUT_MS or not???
 
---
Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1244/>
To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>
Received on 2013-06-11

These mail archives are generated by hypermail.

donate! Page updated May 06, 2013.
web site info

File upload with ASP.NET