curl_multi_cleanup.3 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .\" generated by cd2nroff 0.1 from curl_multi_cleanup.md
  2. .TH curl_multi_cleanup 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_multi_cleanup \- close down a multi session
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLMcode curl_multi_cleanup(CURLM *multi_handle);
  9. .fi
  10. .SH DESCRIPTION
  11. This function is the opposite of \fIcurl_multi_init(3)\fP. Cleans up and removes a
  12. whole multi stack. It does not free or touch any individual easy handles in
  13. any way \- they still need to be closed individually, using the usual
  14. \fIcurl_easy_cleanup(3)\fP way. The order of cleaning up should be:
  15. 1 \- \fIcurl_multi_remove_handle(3)\fP before any easy handles are cleaned up
  16. 2 \- \fIcurl_easy_cleanup(3)\fP can now be called independently since the easy
  17. handle is no longer connected to the multi handle
  18. 3 \- \fIcurl_multi_cleanup(3)\fP should be called when all easy handles are
  19. removed
  20. Passing in a NULL pointer in \fImulti_handle\fP makes this function return
  21. CURLM_BAD_HANDLE immediately with no other action.
  22. Any use of the \fBmulti_handle\fP after this function has been called and have
  23. returned, is illegal.
  24. .SH PROTOCOLS
  25. This functionality affects all supported protocols
  26. .SH EXAMPLE
  27. .nf
  28. int main(void)
  29. {
  30. CURLM *multi = curl_multi_init();
  31. /* when the multi transfer is done ... */
  32. /* remove all easy handles, then: */
  33. curl_multi_cleanup(multi);
  34. }
  35. .fi
  36. .SH AVAILABILITY
  37. Added in curl 7.9.6
  38. .SH RETURN VALUE
  39. CURLMcode type, general libcurl multi interface error code. On success,
  40. CURLM_OK is returned.
  41. .SH SEE ALSO
  42. .BR curl_easy_cleanup (3),
  43. .BR curl_easy_init (3),
  44. .BR curl_multi_get_handles (3),
  45. .BR curl_multi_init (3)