Skip to content

CURLE_UNSUPPORTED_PROTOCOL if curl_multi_remove_handle(multi, easy) called in the middle and easy is reused. #7018

@sergio-nsk

Description

@sergio-nsk

Download a big enough data using the http protocol.

  1. curl_multi_add_handle() -> curl_multi_perform() in a loop -> write_callback() is being raised as expected.
  2. curl_easy is not yet done (no CURLMSG_DONE message), curl_multi_remove_handle() is called. According to the manual:

    You can remove handles at any point in time during transfers.

  3. a) curl_multi_add_handle() -> curl_multi_perform() in a loop -> got CURLMSG_DONE message with the error CURLE_UNSUPPORTED_PROTOCOL.
    b) Or curl_easy_perform() returns the error CURLE_UNSUPPORTED_PROTOCOL.

I expected the following

Once removed from the multi handle, you can again use other easy interface functions like curl_easy_perform on the handle or whatever you think is necessary.

Curl_dyn_reset(&data->state.headerb); is not called after curl_multi_add_handle() and data->state.headerb points to the end header mark "\r\n" left after the first request. Thus, curl tries to parse "\r\nHTTP/1.1 200 OK\r\n" when the response on the second request is being processed.

curl/libcurl version

libcurl v7.74.0

operating system

Any

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions