| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-library Mailing List Archives
Impossible to POST binary data with CURLOPT_POSTFIELDS
From: Spacen Jasset <spacenjasset_at_yahoo.co.uk>
Date: Thu, 11 Oct 2007 14:39:21 +0100
For libcurl 1.17.0
On August 1st url.c was changed (Revision 1.631) to make a copy of post
that the caller need not keep the post buffer arround while curl operates,
unfortunatly this change has broken binary http posts since the code now
strdup.
See: Curl_setstropt
It isn't possible to remedy this and keep the new semantics. The options
are therefore:
0) Revert the code to do what it did before and require the buffer to be
durring the action
1) As (0) and then add a new api to make a copy of the post data
** The following options would change the API and application compatability:
2) Change CURLOPT_POSTFIELDS to include a size parameter
3) Require CURLOPT_POSTFIELDSIZE to be called first
In my copy of libcurl I have done (3) for the moment, but I have not
it involved changing the api or adding a new one.
To reproduce
I used wireshark to monitor the network traffic, and stepping into the code.
char buffer[] = "only\0the first word will get sent.";
curl_easy_setopt(curl, CURLOPT_URL, "http://<any-server>");
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info