cURL / Mailing Lists / curl-library / Single Mail

curl-library

Issue with partial file transfer

From: Grzegorz Sikorski <engineer.gregor_at_gmail.com>
Date: Wed, 18 Apr 2012 09:37:36 +0200

Hello,

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?). When the GPRS
connection is recovered, curl tries to continue file transfer. 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:
*TotalToUpload: 924408, NowUploaded: 0 for transfer: errorBuffer: ,
waiting4con: 0, conSetupFailures: 0, conFailures: 3, totalBytes: 924408,
lastProgressUpdateBytes: 180224, lastProgressUpdateTime: 1334668857,
urlToFile: ftp://10.4.0.1/ftest_02*
But instead of retry full uploading, curl uploads only the part that was
missing in uploading before the connection was lost. This leds to final
error as follows:
*CURL: Transfer has finished with result code: 18("Transferred a partial
file"), errorBuffer: "Uploaded unaligned file size (744184 out of 924408
bytes)", ID: 18, url: "ftp://10.4.0.1/ftest_02"*

Finally on the server side we have broken file. Note this issue does not
occur if the partial file on the server survives connection loose (in such
situation the partial transfer is finished and eventually the file on the
server has proper size).

Please, let me know if this behavior is desired.

Best regards,
Greg

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