|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker Archives
[curl:bugs] Re: #1243 when timeout, CURLINFO_TOTAL_TIME is not ok
From: he qin <hqin6_at_users.sf.net>
Date: Fri, 21 Jun 2013 11:34:53 +0000
It's not ok...
I found that I made a mistake. Follow the code, the callings as follows in my case:
----curl_multi_socket_action
actually, when multi_runsingle is called in the second time, the state == 2(CURLM_STATE_CONNECT) and the result == 28 (!= CURLE_OK). code here:
if(easy->state < CURLM_STATE_COMPLETED) {
/* NOTE: no attempt to disconnect connections must be made
data->state.pipe_broke = FALSE;
if(easy->easy_conn) {//no exec...}
else if(easy->state == CURLM_STATE_CONNECT) {//exec here
multistate(easy, CURLM_STATE_COMPLETED);//set status to CURLM_STATE_COMPLETED
........
if(CURLM_STATE_COMPLETED == easy->state) { //at once, set the result to application
msg->extmsg.msg = CURLMSG_DONE;
result = multi_addmsg(multi, msg);
multistate(easy, CURLM_STATE_MSGSENT);
In hiperfifo.c:
1. curl_multi_add_handle will call update_timer, and update_timer will call multi->timer_cb with timeout_ms=1
2.in my multi->timer_cb, I set a 1ms' timer event. And after 1ms, the libevent will wake up and exec :
3.after the second step, immediately I call
as above, the total time will be zero, because the first call of curl_multi_socket_action set its over status.
I don't know whether you know what I mean. Actually, no bug for curl, just Curl_connect() failed , curl think it's over, no time to spent, so zero is reasonable.
But I think, in my case, the return code 28 is confusing. Maybe in this case , curl return 6 or 7 will be much easier to understand for me.
6 Couldn't resolve host. The given remote host was not resolved.
7 Failed to connect to host.
28 Operation timeout. The specified time-out period was reached according to the conditions.
--- ** [bugs:#1243] when timeout, CURLINFO_TOTAL_TIME is not ok** **Status:** open **Created:** Fri Jun 07, 2013 12:46 PM UTC by he qin **Last Updated:** Tue Jun 18, 2013 09:02 PM UTC **Owner:** Daniel Stenberg hi When I use the multi handle to process one easy handle, I set 80ms timeout for the easy handle. If timeout occur, I get the CURLINFO_TOTAL_TIME, the result is 0? why not 80ms? Read the code, I found, when timeout occur, I call curl_multi_socket_action( multi, CURL_SOCKET_TIMEOUT, 0, &still_running); I see that the CURLINFO_TOTAL_TIME will be update in Curl_done->Curl_pgrsDone. But , as above code, when curl_multi_socket_action was called use CURL_SOCKET_TIMEOUT as the second arg, curl_multi_socket_action will do nothing....(in multi_socket function , all "if" is false) If I want to get the realtime for CURLINFO_TOTAL_TIME, how to do ? --- Sent from sourceforge.net because you indicated interest in <https://sourceforge.net/p/curl/bugs/1243/> To unsubscribe from further messages, please visit <https://sourceforge.net/auth/subscriptions/>Received on 2013-06-21 These mail archives are generated by hypermail. |
Page updated May 06, 2013.
web site info