POST: always set postfieldsize
authorDaniel Stenberg <daniel@haxx.se>
Sat, 24 Sep 2011 22:02:58 +0000 (00:02 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 24 Sep 2011 22:02:58 +0000 (00:02 +0200)
commit745014b7267e8333777807607ba11aa1eb011d46
treeba48a594326765e25c47aebc8c294a2614a41e37
parentb3ea4881a874952045e233f2c6266a3f7b5f38f2
POST: always set postfieldsize

When we use binary posts and regular ones intermixed on a single command
line, we cannot do strlen() etc on the data to figure out the length
(when inserting '&' and more). We must therefore keep track of the post
data length. Then we also end up setting the libcurl option with the
known size, so that we don't risk that libcurl will do strlen() on the
data.

This has the minor side-effect that --libcurl source codes now always
will use CURLOPT_POSTFIELDSIZE but I don't consider that terribly
damaging.

Bug: http://curl.haxx.se/bug/view.cgi?id=3413181
Reported by: Taneli Vähäkangas
src/main.c