cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl hangs after redirected HTTP PUT

From: Ben S <lists.ben_at_gmail.com>
Date: Wed, 30 Jul 2008 19:06:22 -0400

I'm not sure if you need the following info anymore, but here's an
email that I was planning on sending yesterday

Ben Sutcliffe wrote:
> Everything seems to work fine
> 1. curl sends HTTP PUT to www1
> 2. www1 sends back HTTP 307
> 3. curl sends HTTP PUT to www2
> 4. www2 writes HTTP PUT payload to the specified location

CORRECTION:
The file is created at the specified location, but no data is ever
written to the file. It looks like curl is never sending the message
body (the file's payload) after receiving HTTP/1.1 100 Continue in
response to the HTTP PUT request to www2.

I just Wiresharked device l0. After waiting a long time (almost
exactly 600 seconds) following the HTTP/1.1 100 sent by www2, www2
sends a HTTP/1.1 200 OK. After replying with a TCP ACK, the client
then sends a FIN, ACK and the connection is closed without the payload
being sent to www2! Note that prior to the redirect, www1 never
responded with a HTTP/1.1 200 OK and the client *did* send the payload
following the HTTP/1.1 100 Continue received from www1.

Here's the updated verbose output from curl:

prompt> curl -v -T junk.txt -L http://www1/junk.txt
* About to connect() to www1 port 80 (#0)
* Trying 127.0.0.2... connected
* Connected to www1 (127.0.0.2) port 80 (#0)
> PUT /junk.txt HTTP/1.1
> User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
> Host: www1
> Accept: */*
> Content-Length: 5
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 307 Temporary Redirect
< Date: Wed, 30 Jul 2008 00:11:41 GMT
< Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch
< X-Powered-By: PHP/5.2.4-2ubuntu5.3
< Location: http://www2/junk.txt
< Content-Length: 0
< Content-Type: text/html
<
* Connection #0 to host www1 left intact
* Issue another request to this URL: 'http://www2/junk.txt'
* About to connect() to www2 port 80 (#1)
* Trying 127.0.0.3... connected
* Connected to www2 (127.0.0.3) port 80 (#1)
> PUT /junk.txt HTTP/1.1
> User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
> Host: www2
> Accept: */*
> Content-Length: 5
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< Date: Wed, 30 Jul 2008 00:11:41 GMT
< Server: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch
< X-Powered-By: PHP/5.2.4-2ubuntu5.3
< Content-Length: 0
< Content-Type: text/html
<
* Connection #1 to host www2 left intact
* Closing connection #0
* Closing connection #1
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-31