cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: cURL truncating upload file

From: James Smith <james_at_discs.uk.com>
Date: Wed, 6 Oct 2004 13:18:32 +0100

It is also worth noting that curl behaves differently depending on how it is
executed.

1) DIRECTLY FROM THE COMMAND LINE - Seems to work ok (although more testing
is needed).
2) FROM A BATCH FILE ON THE COMMAND LINE - As above.
3) DIRECTLY FROM THE SCRIPT - Small files work, larger ones work but curl
doesn't exit.
4) FROM A BATCH FILE FROM THE SCRIPT - As above.

When it fails to exit, the trace file is showing some peculiarity, all of
the transmitted info is there but at some point after the end of the file
data it stops. A correct execution complete with curl exiting contains the
following...

<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 202 Accepted
<= Recv header, 37 bytes (0x25)
0000: Date: Wed, 06 Oct 2004 11:29:01 GMT
<= Recv header, 16 bytes (0x10)
0000: Server: Apache
<= Recv header, 118 bytes (0x76)
0000: set-cookie: exn-auth-main=703062991; path=/; domain=.amazon.co.u
0040: k; expires=Wednesday, 06-Oct-04 15:59:02 GMT; secure
<= Recv header, 20 bytes (0x14)
0000: Content-Length: 26
<= Recv header, 19 bytes (0x13)
0000: nnCoection: close
<= Recv header, 24 bytes (0x18)
0000: Content-Type: text/xml
<= Recv header, 26 bytes (0x1a)
0000: X-Pad: avoid browser bug
<= Recv data, 26 bytes (0x1a)
0000: <Success>SUCCESS</Success>
== Info: Connection #0 to host secure.amazon.co.uk left intact

At the bottom of the trace, in the cases where curl doesn't exit the file is
still transmitted in it's entirety, but some or all of these lines are
missing.

--
Jay
> -----Original Message-----
> From: curl-users-bounces_at_cool.haxx.se 
> [mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of James Smith
> Sent: 06 October 2004 13:05
> To: 'curl tool talk'
> Subject: RE: cURL truncating upload file
> 
> > > This suggests to me that curl is having some issues, however....
> > 
> > It suggests to me that something is weird. I think it is still 
> > premature to say this problem is in curl's end alone.
> > 
> > > Does any one have any idea what might be causing this?
> > 
> > If you run these POSTs against another server, just for 
> test purposes, 
> > I assume you won't see any of these problems.
> 
> If I run the same arguments against another local server all 
> goes well, but the local server in question isn't set up to 
> receive the file (although I assume curl is still sending it) 
> and it isn't https either.
> 
> > I suggest a suitable mix of strace and ethereal (and possibly
> > gdb) to understand what's going on when it pauses and to 
> find out who 
> > to blame for the early disconnected connection.
> 
> I have used EtherDetect but my knowledge of the ethernet 
> protocols isn't up to examining the results, I could send you 
> the trace if you like.
> 
> --
> Jay
> 
> 
Received on 2004-10-06