cURL / Mailing Lists / curl-library / Single Mail


Re: curl_easy_cleanup Not Closing Connections

From: Linus Nielsen Feltzing <>
Date: Wed, 20 Feb 2013 09:55:51 +0100

On 02/20/2013 09:22 AM, François Veyres wrote:
> I'm using libcurl 7.22, and doing a simple FTP get via the multi
> interface. Everything works fine, but I notice when the transfer is
> complete and I do a curl_easy_cleanup() the FTP control connection is
> not closed. When I do a curl_multi_cleanup() and curl_global_cleanup()
> the control connection is indeed closed.
> Looking at the CHANGES I can't see anything that would affect this in
> later releases. Is this a known problem, or am I misunderstanding
> something?

Curl keeps the FTP connection open even after the easy handle is closed,
so the connection can be reused for subsequent FTP transfers to/from the
same host.

You could try the CURLOPT_FORBID_REUSE option if you really need to
close the connection immediately.

List admin:
Received on 2013-02-20