cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Upload Misbehaving

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 6 May 2008 21:07:58 -0700

On Tue, May 06, 2008 at 04:07:09PM -0700, von wrote:
> I'm using 7.18.1 with ssl support. This is all I got when I ran the code:
> If you will notice there is a message that says: Connection died, retrying a
> fresh connect.
>
> And about the other computer, same exit code but can always upload. Tried that
> a hundred times already.

What curl options did you use? Note also that your user and and password
were in the log you sent--you'll want to change it ASAP.

> * Server auth using Basic with user 'username'
> > PUT /test%2Etxt HTTP/1.1
> > Authorization: Basic ZmdwX3Bzb2Z0OjFBbWVyaWNh
> > User-Agent: curl/7.18.1 (i386-pc-win32) libcurl/7.18.1 OpenSSL/0.9.8g zlib/
> 1.2
> .3
> > Host: theUrl
> > Accept: */*
> > Content-Length: 3
> > Expect: 100-continue
> >
> < HTTP/1.1 200 OK

This is odd. The server is replying with a 200 OK code even though it never
received the data. That doesn't make sense to me. It should reply with a
100 Continue code and then wait for the actual data to be sent.

> < Date: Tue, 06 May 2008 23:00:00 GMT
> < Server: SecureTransport/4.7
> * Added cookie FDX="75415136647a71397535636a50426a714444474748773d3d" for
> domain
> theUrl, path /, expire 0
> < Set-Cookie: FDX=75415136647a71397535636a50426a714444474748773d3d; path=/;
> Secu
> re
> < Accept-Ranges: bytes
> < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> < Features: CHPWD;RTCK;STCK;ASC;DNDISP
> < Transfer-Encoding: chunked
> < Content-Type: text/plain; charset=UTF-8
> <
> { [data not shown]
> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 0 37 0 34 0 0 4 0 --:--:-- 0:00:07 --:--:-- 0*
> Connection #0 to host theURL left intact
> * Re-using existing connection! (#0) with host theURL
> * Connected to theURL (170.146.188.96) port 443 (#0)
> * Server auth using Basic with user 'username'
> > PUT /a.dat HTTP/1.1
> > Authorization: Basic ZmdwX3Bzb2Z0OjFBbWVyaWNh
> > User-Agent: curl/7.18.1 (i386-pc-win32) libcurl/7.18.1 OpenSSL/0.9.8g zlib/
> 1.2
> .3
> > Host: theURL
> > Accept: */*
> > Cookie: FDX=75415136647a71397535636a50426a714444474748773d3d
> > Expect: 100-continue
> >
> * Connection died, retrying a fresh connect

The server stopped responding for some reason, so curl tries again here.
Maybe it got out of sync due to a broken response to the last request.
It's odd that curl doesn't send a Content-Length or Transfer-Encoding:
chunked header in this case--it does in the previous ones, and no header
looks like an RFC violation to me. Maybe the server is getting confused
by that (although it should respond with a 400 or 411 error code instead).

> * Closing connection #0
> * SSLv3, TLS alert, Client hello (1):
> * Issue another request to this URL: 'https://theURL/a.dat'
> * About to connect() to theURL port 443 (#0)
> * Trying 170.146.188.96... connected
> * Connected to theURL (170.146.188.96) port 443 (#0)
[...]
> * Server auth using Basic with user 'username'
> > PUT /a.dat HTTP/1.1
> > Authorization: Basic ZmdwX3Bzb2Z0OjFBbWVyaWNh
> > User-Agent: curl/7.18.1 (i386-pc-win32) libcurl/7.18.1 OpenSSL/0.9.8g zlib/
> 1.2
> .3
> > Host: theURL
> > Accept: */*
> > Cookie: FDX=75415136647a71397535636a50426a714444474748773d3d
> > Expect: 100-continue
> >
> * Empty reply from server

Again, the server doesn't respond at all. Why not? It's an HTTP/1.1 server
so it knows about Expect headers. It should respond with a 100 Continue code
or an error code. Maybe it's getting confused by the lack of Content-Length or
Transfer-Encoding header again.

> * Connection #0 to host theURL left intact
> curl: (52) Empty reply from server
> * Closing connection #0
> * SSLv3, TLS alert, Client hello (1):

It sounds like the server is broken to me, but it doesn't look like curl
is behaving properly, either. Try forcing HTTP/1.0 mode with the -0
option as a workaround and see if that starts working.

I'm not able to reproduce the missing Content-Length or Transfer-Encoding
header problem on my machine. Knowing the command-line options might make
it easier to do that.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-05-07