I did this
The documentation for curl_easy_cleanup does say:
To close an easy handle that has been used with the multi interface, make sure to first call curl_multi_remove_handle to remove it from the multi handle before it is closed.
However the code for curl_easy_cleanup automatically calls curl_multi_remove_handle, so this is normally not strictly required...
Except that curl_multi_remove_handle is called after Curl_detach_connection(data); which could leave the connection in a very bad state, leading to future operations on that connection receiving the data for the operation that was just cleaned up.
I believe this could be improved by moving the Curl_detach_connection(data); down below curl_multi_remove_handle . That note from the documentation could also be removed if this change is made.
I expected the following
No response
curl/libcurl version
libcurl 8.14.0
operating system
All
I did this
The documentation for curl_easy_cleanup does say:
However the code for curl_easy_cleanup automatically calls
curl_multi_remove_handle, so this is normally not strictly required...Except that
curl_multi_remove_handleis called afterCurl_detach_connection(data);which could leave the connection in a very bad state, leading to future operations on that connection receiving the data for the operation that was just cleaned up.I believe this could be improved by moving the
Curl_detach_connection(data);down belowcurl_multi_remove_handle. That note from the documentation could also be removed if this change is made.I expected the following
No response
curl/libcurl version
libcurl 8.14.0
operating system
All