cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with partial file transfer

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 18 Apr 2012 20:05:05 +0200 (CEST)

On Wed, 18 Apr 2012, Grzegorz Sikorski wrote:

> I am using curl (v. 7.24) on ARM processor with linux OS. The box has access
> to some server (with linux OS) via GPRS connection with VPN tunnel set up. I
> found some issue with ftp uploading files to server. When the file is big
> enough sometimes GPRS connection might be lost. In this situation curl
> discards the connection with following error: *CURL: Transfer has finished
> with result code: 28("Timeout was reached"), errorBuffer: "Connection timed
> out after 20002 milliseconds", ID: 18, url: " ftp://10.4.0.1/ftest_02" *This
> error is also pretty strange, but might be OK (is it?).

Why is it strange? If the TCP stream no longer gets any traffic but it isn't
"killed", then it will run into your 20 seconds timeout value...

> When the GPRS connection is recovered, curl tries to continue file transfer.

You mean your application tries to. libcurl will simply do the transfer it
asks for.

> It assumes it already transferred some part and tries to upload rest. But if
> some reason partial file on the server side (which also lost the connection)
> was deleted, on ftp SIZE request server replies with packet: *FTP Response:
> 550 Can't check for file* In this situation I observe strange curl behavior.
> It assumes it should upload whole file again, because reported total size to
> upload is valid full file size:

Sounds logical.

> But instead of retry full uploading, curl uploads only the part that was
> missing in uploading before the connection was lost.

How would libcurl know about that? This is a second request with (in libcurl's
eyes) no relation to the previous one. To me this sounds more like a flaw in
your application. Like for example you didn't seek back to the beginning of
the file?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-18