cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: How to find if the network is down when the transfer is in paused state.

From: Kaviyarasan <kaviyars_at_gmail.com>
Date: Thu, 16 Jun 2011 11:19:21 +0530

>
>
>
> * To determine if the network is down, I'm using the options
>> CURLOPT_LOW_SPEED_LIMIT, CURLOPT_LOW_SPEED_TIME and CURL_TIMEOUT in
>> curl_easy_setopt function. Then, I call curl_easy_pause function to pause
>> the transfer. Because of the above options that I have set, it closes the
>> connection in paused state.
>> *
>
> *
> *
> * If CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME causes the
> connection to get closed while the connection is paused then I might
> consider that a bug... CURL_TIMEOUT is trickier*.

               * -* Yes, When the transfer is Paused,
the CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME options are causing
the connection to get closed. When I set the values to zeor or if I
comment these options, then the connection is not closed and the transfer
remains in Paused state.

> * So, Is there any other way to find if the network is down when the
>> transfer
>> is in paused state?
>> *
>
> *
> *
> * Nothing is being sent or read when the connection is paused so it's not
> really possibly to detect network errors unless you enable TCP keep-alives.
> libcurl doesn't do keep-alives on its own.*
>
>
           - Thanks for the explanation.

>
> * Can I reset the value of the above options in paused state?
>> *
>
> *
> *
> * I think you can!*
>

         It works. While pausing, I'm setting the CURLOPT_LOW_SPEED_LIMIT
and CURLOPT_LOW_SPEED_TIME option values to 0, When the transfer is
resumed, I am resetting it to the desired values.

> --
>
> / 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 2011-06-16