cURL / Mailing Lists / curl-library / Single Mail

curl-library

Strange behavior with multi-interface and async DNS-resolve on windows

From: Christian Hägele <haegele_at_teamviewer.com>
Date: Fri, 7 Oct 2011 08:14:11 +0000 (UTC)

Hello,

when using the multi-interface on windows the async DNS-resolve (not using
c-ares) has a strange behavior (I am using libcurl 7.22.0):
In asyn-thread.c in init_resolve_thread there is a dummy_sock created (line 383).
This dummy_sock is somehow used for the async DNS-resolve. But for some reason
the CURLMPOT_SOCKETFUNCTION is also called with this socket, even though it
has nothing to do with the transfers. It think that is wrong.
It is even more confusing when you are using the CURLOPT_OPENSOCKETFUNCTION and
the CURLOPT_CLOSESOCKETFUNCTION and the CURLMPOT_SOCKETFUNCTION gets called with
a (dummy-)socket never heard of.
In multi.c multi_getsock when the state is CURLM_STATE_WAITRESOLVE the dummy-sock
is pulled out and added to the observed sockets, but this is not necessary when
using a separate thread for async DNS-resolve (as described above on windows).

Regards,

Christian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-10-07