cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Timeout does not work using easy interface inside thread

From: Allen Zhao <xlz_at_kagi.com>
Date: Thu, 3 Nov 2005 13:22:10 -0600 (CST)

On Sat, 5 Nov 2005, Daniel Stenberg wrote:

> On Thu, 3 Nov 2005, Allen Zhao wrote:
>
> >> At what point does it stall? And you have a set time-out with
> >> CURLOPT_TIMEOUT?
> >
> > I have time-out set no less than 60 sec, both the connect timeout and
> > timeout option.
> >
> > The stall happens only with slow sites on curl_easy_perform(). Never
> > return.
>
> I meant at what point in the curl_easy_perform() progress did it stall. Did it
> resolve the name? Did it send its request? Did it get a response? Did the
> transfer begin?

The name resoluation is fine and the transfer actually began, but not
finished. The downloaded file basically is not complete.

At some point of time, I suspect maybe connection is too slow (this is a
Chinese RSS site, connection from US to it is slow for whatever reason).
So I added speed limit to try to time it out:

        // if the download speed is lower than 5byte/sec for more
than 20 sec, timeout
        // set CURLOPT_LOW_SPEED_LIMIT to 5 byte/sec
        m_err = curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 5);
        if (m_err != CURLE_OK) goto onErr;
        // set CURLOPT_LOW_SPEED_TIME to 20 sec
        m_err = curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 20);
        if (m_err != CURLE_OK) goto onErr;

        But this addition does not seem to help out.

        Best regards,

        Allen Zhao

>
> --
> Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
>
Received on 2005-11-05