cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP 1.0 PUT from stdin (was Re: left before release)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 28 Aug 2008 07:48:28 +0200 (CEST)

On Wed, 27 Aug 2008, Dan Fandrich wrote:

> I've just discovered a related problem with HTTP uploads. An upload from
> stdin in HTTP 1.0 mode also causes an invalid request to be sent, without
> a Content-Length: header.

Ah yes!

> Since there's no option for chunked encoding in HTTP 1.0, there's not much
> that can be done in this case. The upload should probably be aborted with
> an error code (which one?) or an empty upload of 0 bytes should be
> performed. Any preferences?

I think detecting this and returning an error code is the better way. It'll
let application authors to notice the problem faster. How about just using
CURLE_UPLOAD_FAILED with some explanatory error string? I couldn't find any
other existing return code that would be suitable...

-- 
  / daniel.haxx.se
Received on 2008-08-28