mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:43:32 +03:00
easy: make curl_easy_perform() return error if connection still there
This typically happens if CURL_CONNECT_ONLY is used and a second curl_easy_perform() is attempted. A connection "taken over" with CURL_CONNECT_ONLY cannot be ended any other way than a curl_easy_cleanup() on the easy handle that holds it. Add test 696 to verify. Closes #16003
This commit is contained in:
parent
2f8ecd5dbd
commit
be82a3605a
5 changed files with 71 additions and 1 deletions
|
|
@ -751,6 +751,11 @@ static CURLcode easy_perform(struct Curl_easy *data, bool events)
|
|||
if(!data)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
if(data->conn) {
|
||||
failf(data, "cannot use again while associated with a connection");
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
}
|
||||
|
||||
if(data->set.errorbuffer)
|
||||
/* clear this as early as possible */
|
||||
data->set.errorbuffer[0] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue