cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-library Mailing List Archives

Re: post binary data using curlopt_postfields option

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 10 Jun 2010 20:08:31 +0200 (CEST)

On Wed, 9 Jun 2010, Vemana Yogi wrote:

> I am sticking to this set of apis to get this working as this works when I
> send 6 requests, but the below fails from seventh request onwards. I get an
> error that an additional 00 was detected in the request format and hence the
> service was not able to decode things right.
>
> curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bs->c_str());
> curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, bs->size());

Did you try using valgrind or similar tool to check for memory-related
problems? I don't see why libcurl would have a problem on the 7th handle, and
I honestly don't think this is a problem within the library...

> I verified encoding and decoding the request data before even sending the
> request to the service, and there was no additional 00, so this tells me
> something is getting added on the wire when it hits the service. I am using
> tcpdump analyze it. In addition, when I do the same thing via php, sending
> multiple requests, everything works.

You mean with PHP/CURL? I mean, effectively using the same library in the end?
If so, what exactly is the difference then between your PHP program and your
non-PHP program?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-10

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET