cURL / Mailing Lists / curl-library / Single Mail


Curl multi and asiohiper

From: Thomas Sanchez <>
Date: Sun, 23 Feb 2014 10:32:35 +0100

Hi there,

While implementing a http client in C++, I stumbled upon to "bug" in
asiohiper and I would like to check here if the fix is correct:

It is said that when curl_multi_socket_action is called it will call
the CURLMOPT_SOCKETFUNCTION *if the status was updated*, this means,
if the status is not updated the socket should be rescheduled to wait
for the same type of event.

So is the following fix correct:

-> wait for and X event / save event // in CURLMOPT_SOCKETFUNCTION
-> event X notified
-> do curl_multi_socket_action (may call CURLMOPT_SOCKETFUNCTION)
-> check if current_event == saved event
--> then: poll for the same event
--> else: do nothing since CURLMOPT_SOCKETFUNCTION, will schedule an event.

Is this correct ? I checked in the sources, and I think I am but I
could have easily missed something...

To trigger the bug, one can simply modify the url to a complete google url like: which do not trigger a redirection but a
complete page with a chunked response.

The code of this wrapper can be found here if someone is interested:

Thanks a lot,

Thomas Sanchez
List admin:
Received on 2014-02-23