cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Multi interface in Windows fails

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Wed, 7 Apr 2004 16:28:42 +0200 (CEST)

On Wed, 7 Apr 2004, Gisle Vanem wrote:

> > This threaded name resolve clearly breaks the multi interface on windows
> > without ares. I can't see how it can be easily solved without us creating
> > a socket in/for the new thread that can be select()ed on.
>
> Looking at it, it seems the transition to CURLM_STATE_WAITRESOLVE is only
> entered after CURLM_STATE_CONNECT.

Right, but when it switches to CURLM_STATE_CONNECT it is because it wants to
connect to a server. It might then first resolve the host name asynchronously,
and when that happens it switches over to CURLM_STATE_WAITRESOLVE and if it
resolves the name synchronously it switches to CURLM_STATE_WAITCONNECT.

> So why can't Curl_multi_ares_fdset() set conn->sock[FIRSTSOCKET] in
> *write_fd_set? It should be != -1 and accepted by select() at that point,
> shouldn't it?
>
> Tracing Curl_multi_ares_fdset() (running lib503), it doesn't seem to be the
> case however (conn->sock[0] == -1). I fail to see why.

Since while being in CURLM_STATE_WAITRESOLVE it still awaits a host name to
resolve and it hasn't yet setup the initial socket to do the connect().

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-04-07