cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Closing an open connection with curl easy handle

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 16 Dec 2014 23:09:20 +0100 (CET)

On Tue, 16 Dec 2014, Arif Ali wrote:

>> How do I stop an ongoing transfer?
>
>> http://curl.haxx.se/docs/faq.html#How_do_I_stop_an_ongoing_transfe
>
> Does it still hold true?

Yes.

> I wish there was an option to cancel the current request using an easy
> handle from other thread. It would have been a lot easier.

Then come on in and help us make such a function work! It should probably
_only_ send a "kill" messsage to the poll()/select() loop, but call would have
to wait on a special kill pipe/socketpair for that purpose only and it would
be a challange to get working portably. Not impossible though. It just hasn't
been made.

Sending such a kill message wouldn't really need any locks or anything so I
figure it could work pretty smoothly.

> Following says that http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html
> easy cleanup must be called after easy perform has finished .
>
> Haven't tried it yet but wondering what would happen if someone calls easy
> cleanup for easy handle from some other thread?

While the first thread is still using that handle? Havoc.

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