cURL / Mailing Lists / curl-library / Single Mail


Re: CURLE_ABORTED_BY_CALLBACK disconnects FTP session

From: Daniel Stenberg <>
Date: Thu, 4 Sep 2014 13:56:17 +0200 (CEST)

On Wed, 3 Sep 2014, LuĂ­s Pinto wrote:

> I'm currently using lib-curl for a project where I might need to abort a
> pending transfer several times. I've followed all the instructions regarding
> the registrations of the proper callback as shown below

> So far so good.. The main problem is that I wish to reuse the previous
> connection, and curl simply disconnects from the server...
> I want to be able to reuse the connection from that handle several times in
> a session, and not open several sessions with that handle in case I have to
> abort any transfers being done there
> I this by curls design?

curl has to disconnect when it isn't sure about the exact state of the
connection and it is left in an "idle" state. Canceling from the callback can
happen at lot of "random" points in the flow and we cannot be sure it can
leave the connection open after that and thus it gets closed.

I'm sure this logic could be improved so that it could keep some connections
open even after a callback cancellation so there is indeed room for
improvement left in the code!


List admin:
Received on 2014-09-04