cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cleaning up lib/hostip.c

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Thu, 22 Apr 2004 10:32:18 +0200

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> I also think we should provide a full Curl_getaddrinfo() function in
> hostthre.c (instead of having it #ifdefed within hostip4.c) because then
> hostip4.c will only have plain sync ipv4 resolve code.

Same for hostip6.c too? Then there would be lots of duplicate code
(check for AF_INET6 etc.) prior to calling Curl_init_resolve_thread()
and getaddrinfo().

I was thinking of hostip6.c (line ~225) having:

#ifdef CURLRES_THREADED
  /* fire up a new resolver thread! */
  if (Curl_init_resolve_thread(conn,hostname,port,&hints)) {
    *waitp = TRUE; /* please wait for the response */
    return NULL;
  }
  infof(data, "Curl_init_resolve_thread() failed for %s; code %lu\n",
        hostname, GetLastError());
#endif /* CURLRES_THREADED */
...

in Curl_getaddrinfo(). I.e. similar to what's in hostip4.c now.

--gv
Received on 2004-04-22