cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curlpp mailing list Archives

[cURLpp] Multi interface bug / issue

From: Piotr Niemcunowicz <piotr.niemcunowicz_at_gmail.com>
Date: Sun, 10 Feb 2008 21:42:16 +0100

Hello again,

this time I`m bugging you for something else ;)

I`ve been using Multi interface for some time and under some strange
circumstances it threw an exception in destructor.

I found that it can happen when curl returns error, becouse remove()
method is used in destructor and I don`t see any try/catch.

There is some bug in curl itself - sometimes it does return error when
it isn`t supposed to. Valgrind shows ugly memory abuse inside
libcurl.so, so in time I`ll report a bug to curl devteam.

See attached patch.

--
Best regards,
Piotr Niemcunowicz

--- ../original/curlpp/Multi.cpp 2007-01-14 01:43:26.000000000 +0100
+++ curlpp/Multi.cpp 2008-02-10 21:00:12.000000000 +0100
@@ -38,7 +38,9 @@
 {
   // remove all the remaining easy handles
   while (!mHandles.empty()) {
- remove (mHandles.begin()->second);
+ std::map< CURL *, const cURLpp::Easy *>::iterator handle = mHandles.begin();
+ curl_multi_remove_handle(mMultiHandle, handle->second->getHandle());
+ mHandles.erase(handle);
   }
   curl_multi_cleanup(mMultiHandle);
 }

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

These mail archives are generated by hypermail.

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

File upload with ASP.NET