cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Craig Perras <cperras_at_u.washington.edu>
Date: Sun, 24 Aug 2008 15:15:44 -0700 (PDT)

> On Sat, 23 Aug 2008, Craig Perras wrote:
>
>> I think the java servlets are broken wrt expect/continue. The
>> app-server immediately responds to expect headers with "100 continue"
...
>> why does curl continue to upload if it sees a response like this?
>>
>> < HTTP/1.1 100 Continue
>> < HTTP/1.1 409 Conflict
>
> If that error truly is received before the (whole) body is sent, then
> I'd call that a silly behavior and curl should only continue sending the
> data if there's a small amount left (as it could then keep the
> connection open), but otherwise I think it should stop sending.
>
> 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):

curl -C 0 -o "out.txt" --upload-file hugehelp.c --limit-rate 4k
http://localhost:8080/upload_svc/

break partway through, then try to upload with a range larger than the
remote file size (my server requires upload resume to start exactly where
it left off). for testing, you could also hard-code the server to not
accept ranges and return 416.

say the remote file-size is 12k; i run curl again with this:

curl -C 20000 -o "out.txt" --upload-file hugehelp.c --limit-rate 4k
http://localhost:8080/upload_svc/

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

* Authentication problem. Ignoring this.

and continues to upload.

a similar issue may also occur with post uploads.

hth,
--craig
-------------------------------------------------------------------
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-25