curl_multi_cleanup(3)

curl_multi_cleanup3

Close down a multi session

Usage

#include <curl/curl.h>
CURLMcode curl_multi_cleanup(CURLM *multi_handle);

Overview

Cleans up and removes a whole multi stack. It does not free or touch any individual easy handles in any way - they still need to be closed individually, using the usual curl_easy_cleanup(3) way. The order of cleaning up should be:

1 - curl_multi_remove_handle(3) before any easy handles are cleaned up

2 - curl_easy_cleanup(3) can now be called independently since the easy handle is no longer connected to the multi handle

3 - curl_multi_cleanup(3) should be called when all easy handles are removed

Passing in a NULL pointer in multi_handle makes this function return CURLM_BAD_HANDLE immediately with no other action.

Examples

int main(void)
{
  CURLM *multi = curl_multi_init();
  /* when the multi transfer is done ... */
  /* remove all easy handles, then: */
  curl_multi_cleanup(multi);
}

Return value

CURLMcode type, general libcurl multi interface error code. On success, CURLM_OK is returned.

Releases

145 releases since Mac OS X 10.3; the text changed 18 times.

  1. 10.3–10.3.9
  2. 10.4–10.6.2
  3. 10.6.3–10.6.8
  4. 10.7–10.7.5
  5. 10.8–10.8.5
  6. 10.9–10.11.6
  7. 10.12–10.12.5
  8. 10.12.6–10.14.6
  9. 10.15–11.5
  10. 12.0.1–12.2
  11. 12.3–12.5
  12. 13.0
  13. 13.1
  14. 13.2
  15. 13.3
  16. 13.4
  17. 13.5–14.1
  18. 14.2–14.4
  19. 14.5–26.5

Availability

Added in 7.9.6

From curl 166.0.0.0.1 in macOS 26.5. Parsed by carta from the page's man source.