cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

Re: [cURLpp] Binary POST body gets mangled after first null

From: Jean-Philippe Barrette-LaPierre <jpb_at_rrette.com>
Date: Tue, 29 Nov 2005 17:31:21 -0500

On November 18, 2005 04:16 am, curlpp_at_rrette.com_at_textnode.com wrote:
> My first post, so hi folks!
>

First, sorry for the delay, I'm away from my living city since the 20th of
october and didn't had my devel platform until this week.

> I'm using the Easy interface to send an HTTP POST with a binary body to a
> server.
>
> Snippet of code:
> ========================================
> std::string Client::Post
> (
> std::string const& url,
> StringList& headers,
> std::string const& data
> )
> {
> try
> {
> cURLpp::Easy request;
> request.setOpt( new cURLpp::Options::PostFields( const_cast<char*>(
> data.c_str() ) ) ); request.setOpt( new cURLpp::Options::PostFieldSize(
> data.size() ) ); request.setOpt( new cURLpp::Options::Url( url ) );
> OptimizeHeaderExpect( headers );
> request.setOpt( new cURLpp::Options::Header( true ) );
> request.setOpt( new cURLpp::Options::HttpHeader( headers ) );
> request.setOpt( new cURLpp::Options::NoProgress( true ) );
> request.perform();
> etc.....
> =========================================
>
> The start of the POST body data looks like this in hex:
>
> 8c 80 98 31 31 39 36 38 35 33 34 2d 66 64 31 62
> 2d 34 37 30 64 2d 38 63 32 65 2d 63 64 61 61 32
> 32 39 32 30 37 64 66 00 8d 90 89 19 80 2b 34 34
> 37 37 etc...
>
>
>
> When the post is sent, an ethereal snoop shows that after the NULL the rest
> of the POST body is replaced by garbage (looks like the process heap).
>
> I have verified that the data.c_str() is definitely correct by writing the
> content out to a file, char-by-char.
>
>
>
> Has anyone come across this before? Have I misused the interface? Is it
> perhaps a known issue?
>

Well there's someone else that mentionned this problem, I never been able to
reproduce it. Well it seems now that's a real problem, so I'll try to figure
this out this weekend.

>
> Many Thanks,
> Darren
>
>
> (P.S.
>
> Software versions:
> curl-7.15.0
> curlpp-0.5.2
>
> O.S.:
> Redhat Linux AS 3.0
> )

-- 
Jean-Philippe Barrette-LaPierre
Coder in wonderland
(try lisp and you'll see the light)
_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2005-12-01

These mail archives are generated by hypermail.

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

File upload with ASP.NET