Skip to content

[RFC] are the curl_multi::get_info and curl_multi::is_finished methods broken? #76

@dvd0101

Description

@dvd0101

IIUC the documentation every messages are returned only once and then removed from the internal handle.

But curl_multi::is_finished consumes all the queue searching for a specific easy handle, discarding the messages it is not interested in.

auto m = curl::curl_multi{};

m.add(easy1);
m.add(easy2);

// do something

std::cout << m.is_finished(easy1) << std::endl;
std::cout << m.is_finished(easy2) << std::endl;

The first call to curl_multi::is_finished could discard a message for easy2.

What if we add an unordered_map[easy_handle->message] in the curl_multi class in order to store the messages returned by curl_multi_info_read (overwrite the old ones should be ok)?

According to this answer on stackoverflow in order to reuse an easy handle you have to remove it, change and then re-add to the multi instance; if so we can cleanup the messages map during the remove phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions