curl_multi_remove_handle.3 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. .\" generated by cd2nroff 0.1 from curl_multi_remove_handle.md
  2. .TH curl_multi_remove_handle 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_multi_remove_handle \- remove an easy handle from a multi session
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *easy_handle);
  9. .fi
  10. .SH DESCRIPTION
  11. Removes a given \fIeasy_handle\fP from the \fImulti_handle\fP. This makes the
  12. specified easy handle be removed from this multi handle\(aqs control.
  13. When the easy handle has been removed from a multi stack, it is again
  14. perfectly legal to invoke \fIcurl_easy_perform(3)\fP on this easy handle.
  15. Removing an easy handle while being in use is perfectly legal and effectively
  16. halts the transfer in progress involving that easy handle. All other easy
  17. handles and transfers remain unaffected.
  18. It is fine to remove a handle at any time during a transfer, just not from
  19. within any libcurl callback function.
  20. Removing an easy handle from the multi handle before the corresponding
  21. transfer is complete might cause libcurl to close the connection \- if the
  22. state of it and the internal protocol handler deem it necessary. Otherwise
  23. libcurl keeps the connection alive in the connection pool associated with the
  24. multi handle, ready to get reused for a future transfer using this multi
  25. handle.
  26. .SH PROTOCOLS
  27. This functionality affects all supported protocols
  28. .SH EXAMPLE
  29. .nf
  30. int main(void)
  31. {
  32. CURLM *multi = curl_multi_init();
  33. int queued = 0;
  34. /* when an easy handle has completed, remove it */
  35. CURLMsg *msg = curl_multi_info_read(multi, &queued);
  36. if(msg) {
  37. if(msg->msg == CURLMSG_DONE) {
  38. /* a transfer ended */
  39. fprintf(stderr, "Transfer completed\\n");
  40. curl_multi_remove_handle(multi, msg->easy_handle);
  41. }
  42. }
  43. }
  44. .fi
  45. .SH AVAILABILITY
  46. Added in curl 7.9.6
  47. .SH RETURN VALUE
  48. CURLMcode type, general libcurl multi interface error code.
  49. .SH SEE ALSO
  50. .BR curl_multi_add_handle (3),
  51. .BR curl_multi_cleanup (3),
  52. .BR curl_multi_init (3)