curl-library
Re: Using libcurl on top of lwip on POSIX embedded platform (take 2)
Date: Mon, 19 Mar 2012 12:41:32 +0100
"Guenter" <lists_at_gknw.net> wrote:
> If its not possible to check if initialisation is required or not then
> its probably worth to talk to the lwip team and suggest an enhancement
> to lwip_init() so that it does simply nothing if the stack is already
> initialized.
I can only speak for Windows. We can probably assume that lwIP on Win can
never replace the real tcp/ip stack (Winsock). So the init of lwIP+libcurl is per
process. There is AFAICS no global settings at the bottom of lwIP. And the win32
port (src/contrib/ports/Win32/*.c) doesn't use registry or a config-file. It could
though. Such things are deliberately left to the implementors of a specific OS-port
of lwIP.
And the core function lwip_init() does not initialise stuff like netif, mask & address.
But only things that are common to most tcp/ip-stacks; like loopback address etc.
See core/init.c.
Since lwip+libcurl needs to be configured per process the mask/address etc. should
be called from libcurl. Where else? Similar to how the lwip application samples does this.
I have looked into this some time ago. Can you Guenter take a look at the attached
lwip-thread.c and see what you think? curl_lwip_init() should be called from win32_init()
in easy.c. I'm not happy with this either since the stuff therein are hardcoded ATM.
--gv
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- text/plain attachment: lwip-thread.c