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] Bug in HTTP Forms

From: Piotr Niemcunowicz <piotr.niemcunowicz_at_gmail.com>
Date: Wed, 06 Feb 2008 23:04:10 +0100

Jean-Philippe Barrette-LaPierre wrote:
> Code put in my own repository, will make the changes available in the
> next release.
>
>
> On 5-Feb-08, at 4:41 PM, Piotr Niemcunowicz wrote:
>
>
>> Regarding example19: there should be a code to dispose pointers
>> from std::list<cURLpp::FormPart *> formParts.
>> Or maybe should the cURLpp take the ownership of pointers and free
>> them instead of cloning and leaving this to the library user?
>>
>>
>
> Totally agree with you. I don't know what I was thinking. I'll put
> the changes in the next release too.
>
> BTW, thank you very much for the bug report AND the fix!
>

Great, please review attached patch, it should settle both things :)

BTW. when the new release will be avaliable?

--
Best whishes,
Piotr Niemcunowicz

--- Form.cpp 2007-08-28 01:35:16.000000000 +0200
+++ Form.cpp 2008-02-06 22:47:54.000000000 +0100
@@ -26,13 +26,12 @@
 
 
 cURLpp::HttpPost::HttpPost(const Forms &posts)
+ : mFirst(NULL)
+ , mLast(NULL)
 {
- cURLpp::FormPart *form;
- Forms::const_iterator pos;
- for(pos = posts.begin(); pos != posts.end(); pos++) {
- form = (*pos)->clone();
- mForms.push_back(form);
- form->add(&mFirst, &mLast);
+ for(Forms::const_iterator pos = posts.begin(); pos != posts.end(); pos++) {
+ mForms.push_back(*pos);
+ (*pos)->add(&mFirst, &mLast);
   }
 }
 

_______________________________________________
cURLpp mailing list
cURLpp_at_rrette.com
http://www.rrette.com/mailman/listinfo/curlpp
Received on 2008-02-06

These mail archives are generated by hypermail.

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

File upload with ASP.NET