cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Detect failed donwloads

From: Ruslan Gaifulin <omskannihilator_at_gmail.com>
Date: Mon, 17 Feb 2014 10:46:11 +0700

What must I check? I figured that download stops after a long connection
fail time, let's say, about 2 minutes or more. If I disconnect a network
for 10-30 sec downloading resumes.
btw, the code is

http://pastebin.com/FW7hGuCv

On 16 February 2014 16:33, Dan Fandrich <dan_at_coneharvesters.com> wrote:

> On Sun, Feb 16, 2014 at 11:27:37AM +0700, Ruslan Gaifulin wrote:
> > I download multiple files simultaneously with curl_multi_perform
> > How can I detect if connection is lost during the downloading?
>
> http://curl.haxx.se/docs/faq.html#Why_doesn_t_cURL_return_an_error
>
> > When I simulate the lost connection (disconnecting wi-fi)
> > select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
> > returns 0, but it also returns 0 right before the beginning of
> downloading.
> > If I connect back, then the downloading resumes but eventually a file
> turns out
> > to be corrupted.
>
> This shouldn't happen without an easy handle also return an error code.
> Are you
> sure that isn't happening?
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-- 
Cheers,
Ruslan Gaifulin
<O.Yurchenko_at_omsk.otpbank.ru>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-17