curl-library
Re: lwIP not using getaddrinfo()
Date: Fri, 23 Sep 2011 13:16:04 +0200
"Gisle Vanem" <gvanem_at_broadpark.no> wrote:
> 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
I see why. lwip_init() is called from easy.c. But the main input processing
loop (polling the ifaces, checking timers, taking care of retransmissions etc.)
is supposed to be called from an interrupt context. That's the idea on embedded
systems where that is safe to do. This main-loop is missing in libcurl.
On Windows (no interrupt context) one needs to call lwIP's tcpip_init(). This should
create a threaded main-loop that gets everything going. Ref.
<lwip-root>/src/contrib/ports/win32/test.c
Yang are you there? What's your idea on this, since you added the lwIP stuff?
What's the motivation for calling lwip_init() only? AFAICS, this doesn't call the
required WinPcap init stuff. How can we best make libcurl+lwIP support
embedded and Win32 targets?
--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-23