cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: http upload: how to stop on error (after continue)?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 26 Aug 2008 00:01:44 +0200 (CEST)

On Sun, 24 Aug 2008, Craig Perras wrote:

>> Can you provide a test case that repeats this behavior? (with curl 7.18.2
>> or later of course)
>
> It's easy to reproduce if you have a server that accepts PUT, but tests do
> rely on server behaviour. This is what I do (approx):

> you can also try with invalid username/pwd. curl responds with:

Yes, this is interesting and slightly depressing:

When I make a URL on an Apache http server require auth and I run curl against
it like this:

         curl $url -v --limit-rate 4k -T $200kfile

The server immediately responds with "HTTP/1.1 100 Continue" and curl starts
sending away the file.

After curl sent 192 kilobytes (48 seconds!), 93% of the 200K, the response
headers are received and they say "HTTP/1.1 401 Authorization Required" ...
The 192k limit is 100% repeatable too (even when I change transfer rate) as
long as the file size remains the same. Disabling Expect: 100-continue makes
no difference.

When I tried a 1296721 bytes file, curl sent 1264k bytes before the server
sent the 401 response...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
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-08-26