cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using libcurl on top of lwip on POSIX embedded platform (take 2)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 17 Mar 2012 22:36:12 +0100 (CET)

On Fri, 16 Mar 2012, Mason wrote:

> Technically, one should not call lwip_init, as lwip_init is called from
> tcpip_init. Philosophically, why would library code initialize the network
> stack on which the library code depends?

Philosophically, we do it for win32 if the correct bit is set
(CURL_GLOBAL_WIN32) because it might be that the application doesn't use
anything else network-related than libcurl and then it might make sense. Do
you think it would make sense to add another such bit, like CURL_GLOBAL_LWIP
to cater for the user to decide which way to do it?

> On my platform, at boot-time, the network stack is one of the first things
> initialized, long before any thread has had a chance to run libcurl code.
> Perhaps this is a Windows peculiarity?

How can it be Windows specific? Isn't it rather about how a system or
application is supposed to initialize lwip? What does lwip documentation or
tradition say?

> For the time being, I've applied the following patch. Comments?

> +#elif defined(USE_LWIPSOCK) && defined(HAVE_WINDOWS_H)
> lwip_init();
> #endif

I really don't like this being dependent on the presence of windows.h. I'd
rather we make a decision and we document that - it will still be a good idea
to produce a short description somewhere on how to build and use libcurl with
lwip so that future users won't have to get through all this work that you
have!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-17