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: #1243 when timeout, CURLINFO_TOTAL_TIME is not ok

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

thank you for your reply, I use the nearest version : curl-7.30.0

here is my example (just a little modification for curl-7.30.0/docs/examples/hiperfifo.c, here I use the nearest version of libevent)

--------------
see the attachment.
--------------
use this command to build:

gcc hiperfifo.c -I../../include -I ../../../../libevent-2.0.21-stable/include -lcurl -L ../../lib/.libs/ -levent -L ../../../../libevent-2.0.21-stable/.libs/ -Wl,-rpath=../../lib/.libs/:../../../../libevent-2.0.21-stable/.libs/

----------------
you can use an illegal url to test, like this:

echo 'http://123.456.com' > hiper.fifo
---------------
the result is :

heqin_at_ubuntu:~/source/test/curl-7.30.0/docs/examples$ ./a.out
Creating named pipe "hiper.fifo"
Now, pipe some URL's into > hiper.fifo
Adding easy 0x9005710 to multi 0x8ffe590 (http://123.456.com)
multi_timer_cb: Setting timeout to 1 ms
* Closing connection 0
multi_timer_cb: Setting timeout to 79 ms
REMAINING: 0
DONE: http://123.456.com/ => (28) , use = 0 ms
multi_timer_cb: Setting timeout to -1 ms
REMAINING: 0

-----------------

now, I don't have any idea for fixing this. I found that in curl_multi_remove_handle function, it will call the Curl_done->Curl_pgrsDone to flush the total time, but after calling curl_multi_remove_handle function, the easy handle will be Not available, and the total time is not exact because the total time is depending on the time of calling the curl_multi_remove_handle.

I think we can call the Curl_done function when timeout occur, but I don't try it. just a little suggestion :)

---
** [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:** Sun Jun 09, 2013 09:31 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-11

These mail archives are generated by hypermail.

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

File upload with ASP.NET