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] Re: #1244 multi handle process more than one easy handle, timeout control error

From: he qin <hqin6_at_users.sf.net>
Date: Tue, 11 Jun 2013 14:13:15 +0000

Can I reset the "now" variable when the second place called multi_runsingle ? I don't know it would cause any other problem and there is no any problem so far. But to be safe, I just smaller the timeout from 40ms to 5ms. It works OK so far.

Wating for your fixing .

thank you for your reply again.

---
** [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:** Tue Jun 11, 2013 09:01 AM 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