Haxx ad

curl's project page on


cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1792649 ] empty upload confuses curl if a re-used connection

From: <>
Date: Tue, 11 Sep 2007 12:10:52 -0700

Bugs item #1792649, was opened at 2007-09-11 19:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Kris (tinker105)
Assigned to: Nobody/Anonymous (nobody)
Summary: empty upload confuses curl if a re-used connection

Initial Comment:
(spinoff from bug #1779054)

In my client program (and a custom FTP server), I issue 2 uploads using the same host and file. If I don't rewind the file (using fseek), I get a "Connection died, trying a fresh connect" msg after the 2nd STOR even though the operation does succeed (no data was actually needed for this 2nd PUT). When the operation is reissued (by curl) with a new connection, the file still hasn't been rewound, but curl completes it OK (i.e. no "Connection died" msg). Admittedly, a PUT that doesn't actually transfer any data is a bit unusual, but it seems wrong that the results would be so different just because one is with a "re-used" connection.

The client uses (in order):
fd = fopen
curl_easy_setopt (,CURLOPT_URL,)
curl_easy_setopt (,CURLOPT_UPLOAD,)
curl_easy_setopt (,CURLOPT_READDATA, fd)
curl_easy_setopt (,CURLOPT_VERBOSE, 1)
curl_easy_setopt (,CURLOPT_URL,)

Verbose output:
< 226- %WORLD-S-XWOK, A request was successfully completed.
< 226 ***** Xfer finished ***** code=<0>
* Connection #0 to host sthdev2 left intact
* Re-using existing connection! (#0) with host sthdev2
* Connected to sthdev2 ( port 1985 (#0)
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||63051|)
* Trying * connected
* Connecting to ( port 63051
> STOR confirm
< 150 Opening BINARY mode data connection.
* Connection died, retrying a fresh connect
< 226- %L-I-XLDINFO, \Xfer op: started Fri Aug 31 10:29:49 2007\
< 226- %WORLD-S-XWOK, A request was successfully completed.
< 226 ***** Xfer finished ***** code=<0>
< 221 Goodbye.
* Closing connection #0
* Issue another request to this URL:
* About to connect() to sthdev2 port 1985 (#0)
* Trying * connected
* Connected to sthdev2 ( port 1985 (#0)
< 220 sthdev2 FTP server (Version 3.3) ready.
> USER xxx
[... 2nd put is re-issued (and succeeds) even though it already succeeded above]

> curl -V
curl 7.17.0-20070910 (sparc-sun-solaris2.6) libcurl/7.17.0-20070910 OpenSSL/0.9.8a zlib/1.1.3
Protocols: tftp ftp telnet dict http file https ftps
Features: Largefile NTLM SSL libz


You can respond by visiting:
Received on 2007-09-11

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET