cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: lwIP not using getaddrinfo()

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Fri, 23 Sep 2011 01:40:35 +0200

"Daniel Stenberg" <daniel_at_haxx.se> wrote:

> On Thu, 22 Sep 2011, Gisle Vanem wrote:
>
>> But I cannot make sense of the messy #ifdef-ing to select the "correct"
>> resolver. We have been told for like 10 years that gethostbyname() has been
>> deprecated. At least on Windows. So someone help me fix this.
>
> It currently depends on ENABLE_IPV6, which in lib/setup.h (line 495) will
> define CURLRES_IPV6 then.
>
> Does lwIP support IPv6? Otherwise I guess you can leave ENABLE_IPV6 undefined
> and just explicity define CURLRES_IPV6 and undefine CURLRES_IPV4,

It does. Trying that, I see lwIP uses getaddrinfo(), then calls gethostbyname()
internally and then hangs forever waiting for some event:

...
kernel32.dll!WaitForSingleObjectEx+0xa8
kernel32.dll!WaitForSingleObject+0x12
lwip.dll!sys_arch_sem_wait+0xbb
lwip.dll!netconn_gethostbyname+0xb6
lwip.dll!lwip_gethostbyname+0x11
libcurl.dll!Curl_getaddrinfo+0x43
libcurl.dll!Curl_resolv+0xd1
libcurl.dll!Curl_resolv_timeout+0x44
libcurl.dll!resolve_server+0x12d
libcurl.dll!create_conn+0x4ea
libcurl.dll!Curl_connect+0x1d
libcurl.dll!Curl_do_perform+0x5a
libcurl.dll!Curl_perform+0x17
libcurl.dll!curl_easy_perform+0xa0
curl.exe!operate+0x2468
...

Must check further.

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