Hi all,

When performing a standard HTTP POST (w/o chunked encoding) with a custom
read function, a common mistake is to forget to explicitly set the POST size
via `CURLOPT_POSTFIELDSIZE`.

This results in libcurl sending a negative content length:

    Content-Length: -1

, which gives a bad request.

The question is: should we prevent libcurl to send the request by failing early?

IMHO that would be helpful for the caller to help him understand the misuse.

Before sending a patch, I was wondering if `CURLE_UPLOAD_FAILED` would be the
best error code to use there.

Any suggestion or remark?

Thanks!

Cédric


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to