cURL / Mailing Lists / curl-library / Single Mail


Re: OPENSOCKETFUNCTION hook not called for all socket creations on Windows

From: Daniel Stenberg <>
Date: Wed, 14 Dec 2011 16:23:18 +0100 (CET)

On Wed, 14 Dec 2011, Christian Hägele wrote:

>> Hi, on Windows, libcurl does not seem to honor the CURLOPT_OPENSOCKETFUNCTION
>> hook for the 'dummy_sock' socket created in init_resolve_thread() function.

> I had the same issue reported earlier.(
> gmane.comp.web.curl.library/33280)
> I am using boost::asio to manage the sockets and events on the sockets. My
> workaround for this issue is to keep track of all sockets I opened myself
> called with a unknown socket I just ignore it.

This is probably to be considered a bug. I'll appreciate a patch!

> It is possible that CURLOPT_CLOSESOCKETFUNCTION gets called and after that
> the CURLMOPT_SOCKETFUNCTION gets called with the socket you closed just
> before and the CURL_POLL_REMOVE action is set.

Yes, this is probably even the order in which these events happen most of the
times. I think this is primarily a matter of improving the documentation to
make it become less surprising.


List admin:
Received on 2011-12-14