cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_cleanup Not Closing Connections

From: François Veyres <fveyres_at_gmail.com>
Date: Thu, 21 Feb 2013 08:04:23 +0100

On Wed, Feb 20, 2013 at 2:25 PM, Linus Nielsen Feltzing <linus_at_haxx.se>wrote:

> On 02/20/2013 11:36 AM, François Veyres wrote:
>
>> That's not how I understood the behaviour... From the
>> curl_easy_cleanup() manpage, "This will effectively close all
>> connections this handle has used and possibly has kept open until now."
>
>
> Ooops. I don't think that applies when you have used the handle with the
> multi interface. I'll have to check that, and perhaps update the
> documentation.
>
> In my case there will be 100's of thousands of clients, each doing
>> multiple FTP gets, so I want the control connection to persist but I
>> can't afford to keep it open when the transfers are done. I tried
>> setting CURLOPT_FORBID_REUSE = 1 after the last transfer but before
>> calling curl_easy_cleanup() but that didn't close the control connection.
>> So is there a way for me to immediately close the connection after I'm
>> finished my transfers?
>
>
> Hmm, CURLOPT_FORBID_REUSE should be set before the transfer, not after.
> But if you do, it will reopen the control channel for every transfer. Not a
> good idea, sorry...
>
> I think your best option is to close the multi interface with
> curl_multi_cleanup() when you are done.
>

Ahhh... the curl_multi_cleanup() worked perfectly. Thanks, Linus.

François

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-21