cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Timout in HTTP data transfer

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 18 Nov 2010 13:54:05 -0800

On Thu, Nov 18, 2010 at 01:13:30PM +0530, arnuld uttre wrote:
> I am using libcurl to receive some data from web server. I am using
> these options:
>
> curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
> curl_easy_setopt(curl, CURLOPT_TIMEOUT, 100);
>
> I am already connected to the server hence do not need
> CURLOPT_CONNECTTIMEOUT options to use. I am just waiting for the data
> to arrive. Web server is configured in such a way that it will send me
> data after 1-2 min when I made a request. Even though I have put 100
> seconds in CURLOPT_TIMEOUT, libcurl always times out just after 60
> seconds. If web-server immediately sends the data then its ok but I am
> unable to use a custom timeout option.
>
> any clues ?

The values must be longs, not int. Try using 1L and 100L as your values.
What is libcurl doing when the timeout occurs? If it's timing out in the
DNS lookup, then the DNS resolver you're using becomes an issue. What
happens if you increase or decrease the value from 100? Does the 60
second timeout change?

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-18