cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

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: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 11 Sep 2007 15:25:01 -0700

Bugs item #1792649, was opened at 2007-09-11 21:10
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1792649&group_id=976

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: ftp
Group: bad behaviour
Status: Open
>Resolution: Fixed
>Priority: 4
Private: No
Submitted By: Kris (tinker105)
>Assigned to: Daniel Stenberg (bagder)
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_init()
curl_easy_setopt (,CURLOPT_URL,)
curl_easy_setopt (,CURLOPT_UPLOAD,)
curl_easy_setopt (,CURLOPT_READDATA, fd)
curl_easy_setopt (,CURLOPT_VERBOSE, 1)
curl_easy_perform
curl_easy_setopt (,CURLOPT_URL,)
curl_easy_perform

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 (10.1.4.7) port 1985 (#0)
[...]
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||63051|)
* Trying 10.1.4.7... * connected
* Connecting to 10.1.4.7 (10.1.4.7) 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>
> QUIT
< 221 Goodbye.
* Closing connection #0
* Issue another request to this URL:
'ftp://sthdev2:1985/confirm'
* About to connect() to sthdev2 port 1985 (#0)
* Trying 10.1.4.7... * connected
* Connected to sthdev2 (10.1.4.7) 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

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

>Comment By: Daniel Stenberg (bagder)
Date: 2007-09-12 00:25

Message:
Logged In: YES
user_id=1110
Originator: NO

I've committed a fix just now, and added test case 541 to verify.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1792649&group_id=976
Received on 2007-09-12

These mail archives are generated by hypermail.

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

File upload with ASP.NET