cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-829827 ] curl -C - http://... exit(18) if download already complete

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Fri, 24 Oct 2003 13:50:13 -0700

Bugs item #829827, was opened at 2003-10-24 13:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=829827&group_id=976

Category: http
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: David Hull (dlhull)
Assigned to: Daniel Stenberg (bagder)
Summary: curl -C - http://... exit(18) if download already complete

Initial Comment:
Curl exits with status 18 for an http URL if the "-C -"
option is given
and the download is already complete. Here's an
example. First we download the file, and then we
attempt to download it again with the "-C -" option.

$ curl -O
http://www.paracel.com/images/logo_paracel_355X21.gif
  % Total % Received % Xferd Average Speed
 Time Curr.
                                 Dload Upload Total
 Current Left Speed
100 1287 100 1287 0 0 27382 0 0:00:00
 0:00:00 0:00:00 114k

$ echo $?
0

$ curl -C - -O
http://www.paracel.com/images/logo_paracel_355X21.gif
** Resuming transfer from byte position 1287
  % Total % Received % Xferd Average Speed
 Time Curr.
                                 Dload Upload Total
 Current Left Speed
  0 1287 0 0 0 0 0 0 --:--:--
 0:00:16 --:--:-- 0
curl: (18) transfer closed with 1287 bytes remaining to
read

$ echo $?
18

If the http download is partial and curl transfers some
data
for the "-C -" run, curl exits with 0 status as I would
expect.

Returning non-0 exit when the download is already
complete for
http is not consistent with how curl behaves for ftp URLs.

$ curl -O ftp://ftp.ncbi.nih.gov/blast/matrices/MATCH
  % Total % Received % Xferd Average Speed
 Time Curr.
                                 Dload Upload Total
 Current Left Speed
100 1850 100 1850 0 0 1604 0 0:00:01
 0:00:01 0:00:00 12906

$ echo $?
0

$ curl -C - -O ftp://ftp.ncbi.nih.gov/blast/matrices/MATCH
** Resuming transfer from byte position 1850
  % Total % Received % Xferd Average Speed
 Time Curr.
                                 Dload Upload Total
 Current Left Speed
  0 0 0 0 0 0 0 0 --:--:--
 0:00:01 --:--:-- 0

$ echo $?
0

$ curl --version
curl 7.10.7 (sparc-sun-solaris2.9) libcurl/7.10.7
OpenSSL/0.9.7c zlib/1.1.3
Protocols: ftp gopher telnet dict ldap http file https
ftps
Features: SSL libz NTLM

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=829827&group_id=976

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
Received on 2003-10-24