-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
Description
I did this
If CURLOPT_CONNECT_ONLY
socket was connected using mutli interface, then curl_easy_send
returns CURLE_UNSUPPORTED_PROTOCOL
. Here is minimal reproducer.
main.cpp:
#include <curl/curl.h>
#include <cassert>
int main(int, char**) {
CURL* e = curl_easy_init();
curl_easy_setopt(e, CURLOPT_URL, "http://google.com/");
curl_easy_setopt(e, CURLOPT_CONNECT_ONLY, 1);
curl_easy_setopt(e, CURLOPT_VERBOSE, 1);
CURLM* m = curl_multi_init();
curl_multi_add_handle(m, e);
int count;
do {
curl_multi_perform(m, &count);
} while (count > 0);
CURLMsg* msg = curl_multi_info_read(m, &count);
assert(msg);
assert(count == 0);
assert(msg->easy_handle == e);
assert(msg->data.result == CURLE_OK);
curl_multi_remove_handle(m, e);
const char buf[] = "XYZ";
size_t sent;
CURLcode res = curl_easy_send(e, buf, sizeof(buf), &sent);
assert(res == CURLE_OK); // CURLE_UNSUPPORTED_PROTOCOL is returned
curl_easy_cleanup(e);
curl_multi_cleanup(m);
return 0;
}
I expected the following
curl_easy_send is usable after curl_multi_remove_handle returns;
curl/libcurl version
7.84.0
operating system
Linux WSL2