cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLE_ABORTED_BY_CALLBACK disconnects FTP session

From: Luís Pinto <luis.pinto_at_avid.com>
Date: Wed, 3 Sep 2014 16:56:31 +0000

Hi All,

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

// Pass callback to notify curl if should abort or not
m_curlErrorCode = ::curl_easy_setopt (m_curl, CURLOPT_XFERINFOFUNCTION, MyClass::checkCurlCancelingCallback);
m_curlErrorCode = ::curl_easy_setopt (m_curl, CURLOPT_XFERINFODATA, this);
m_curlErrorCode = ::curl_easy_setopt (m_curl, CURLOPT_NOPROGRESS, 0);

curl_easy _perform is then executed in its own thread..

In the parent thread, I'm able to set a given variable (properly protected with mutexes) to true, making the checkCurlCancelingCallback return 1 (effectively cancelling any transfer)

Curl_easy_perform returns almost immediately with the proper CURLE_ABORTED_BY_CALLBACK error code..

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?

The FTP server that I'm currently using is the FileZilla server

Any help would be greatly appreciated!

Luís Pinto

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-09-03