cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: When to call curl_multi_clean

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 10 Sep 2008 00:33:04 -0700

On Wed, Sep 10, 2008 at 11:51:14AM +0530, Naiem Shaik wrote:
> Can any one please let me know what is the correct usage of curl_multi_handle.
> This is the high level logic of webkit=curl interaction
> 1- create a multi handle at the start of program
> 2- keep creating easy handles for each request
> 3- when request is done remove it from multi handle and clean up the
> handle
> 4- multi handle is never released (stays till the end of program)
>
> But as per the documentation we should clean up the multi handle as well.
> So my question is can we re-use the same multi handle without ever
> performing curl_multi_cleanup.
> The reason is we are seeing leak in curl_connect and curl_open with
> this approach.

You can add and remove easy handle to a multi handle as often as you want
without cleaning up the multi handle. There shouldn't be a memory leak
doing this, naturally. Test cases 532 & 533 do something like this and the
curl test harness doesn't show any leaks. What version of the library are
you using? Under what conditions does it leak? Can you show us your
failing code?

Note that this question should really be asked on the curl-library mailing
list instead of here.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-10