I have a situations where, using the multi-interface, I have a set of transfers, and at some point I would like to stop it, even if I’m not sure if the transfer has already completed or not. Imagine the following situation:
CURL* h = curl_easy_init();
curl_easy_setopt(blablabla);
// more setopts, url, etc
curl_multi_add_handle(my_curlm, h);
int running_transfers;
curl_multi_perform(my_curlm, &running_transfers);
// At some point in the future:
curl_multi_remove_handle(my_curlm, h);
At this point, I want to know the effects of removing a handler respect to the message queue that you can query using curl_multi_info_read
. So, if I remove an easy handler from a multi handler:
- and the transfer was not done yet, will the message queue be populated with a new message for that handler indicated it’s finished? If that’s the case, is there any result code that I can check to know that the transfer ended because it was explicitely stopped? NOTE: One of the CURL error codes is
CURLE_ABORTED_BY_CALLBACK
, but I don’t know if stopping the transfer by removing it from the multi handler is covered by this error code. - and the transfer was already done and there’s a new message inside the queue, or if the transfer was not done yet but stopping it inserted a new message in the queue (the above scenario), if I then remove the easy handler BEFORE calling
curl_multi_info_read
, will the message dissapear from the queue, or do I need to keep the easy handler alive aftercurl_multi_remove_handler
UNTIL I checked all the messages in the queue?