cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Connection and Response Timeout for Curl Handle

From: Praveen Pvs <meetpraveenpvs_at_gmail.com>
Date: Mon, 16 Mar 2015 17:08:49 -0500

On Mon, Mar 16, 2015 at 12:18 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 3 Mar 2015, Praveen Pvs wrote:
>
> I have set my connection time out to be 10 and response time out to be 10
>> secs in my configuration. Following is the code snippet for settings these
>> values to the curl handle.
>>
>> /* Set the connection timeout */
>> curl_easy_setopt(locHandle, CURLOPT_CONNECTTIMEOUT, hostDef.conTimeOut);
>>
>
> Are you making sure this is a 'long' and nothing else?

 hostDef.conTimeOut is an int data type, i have changed it to long now.
Thanks for bringing that up. Is that causing the problem here?

>
>
> Please observe the logs of my application below, curl_easy_perform
>> function is called at 09:01:58:433 and it returned value 6 at 09:02:54:479.
>> it took close to 56 secs. I expect it to take 10 secs since conntimeout is
>> set to 10. Am i missing something here?
>>
>
> Which platform is this and which libcurl version? If you use curl command
> line tool on this URL, does it timeout appropriately or does it show the
> same problem?
>
> We are using 7.21.0 version of libcurl and application runs on unix/linux
platform. I have not tried the command line tool. Always tried from the
application.

> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-16