cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl hangs after redirected HTTP PUT

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 30 Jul 2008 14:10:57 -0700

On Wed, Jul 30, 2008 at 12:31:29AM -0700, Dan Fandrich wrote:
> On Tue, Jul 29, 2008 at 06:36:15PM -0400, 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
> >
> > Problem:
> > After curl receives the final HTTP/1.1 100 Continue from www2, curl
> > just hangs there waiting for something (maybe HTTP GET payload
> > data...even though no HTTP GET was issued?).
>
> I've been able to reproduce this. I've created test case 1051 to try to
> create an automated test scenario, but there's a problem in the test harness
> that prevents the HTTP/1.1 100 code from being sent. So that makes two
> problems to solve (which I've added to the TODO-RELEASE file).

I looked into this a bit and the problem is due to the PUT case not
rewinding the file after a redirect. When it comes time to send the file
the second time, the read callback returns end-of-file so libcurl has
sends nothing. I'm not sure the best place to put that rewind in the code.
I've added a couple of related tests (1052 and 1055) which are likely
also failing due to the same issue.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
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-30