cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP POST: fail early if unknown data size (read function)

From: Cédric Deltheil <cedric_at_moodstocks.com>
Date: Mon, 13 Jan 2014 10:18:16 +0100

Le 12 janv. 2014 à 22:20, Rich Gray <rgray_at_plustechnologies.com> a écrit :

> Although it is probably the closest code for this error, CURLE_UPLOAD_FAILED seems wrong. In my mind, it implies a wire error,

Just a precision: the corresponding error string is "Upload failed (at start/before it took off)", which I found appropriate here at first.

> whereas it would really be a library parameter/setup error.

If we go ahead with the ability to report a misuse (which I would like to discuss - see my last post), it could indeed be even better to use a very explicit error code.

> if the road to a new return code is taken, perhaps add more than one:
>
> CURLE_MISSING_PARAMETER
> CURLE_INVALID_PARAMETER
> CURLE_INCONSISTENT_PARAMETER

It makes sense. But to be honest I would prefer introducing a single one to first address the (minor) issue I reported here. And I'm not so sure if the better solution is to report the misuse and fail early (which introduces a bit of complexity - e.g for auth requests with multiple phases), or do as HTTP PUT does so far, i.e simply not send any Content-Length header if the post size is unknown (again, see my last post).

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-13