cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl with IPv6 support enabled on Windows

From: Gisle Vanem <giva_at_bgnett.no>
Date: Tue, 04 Jan 2005 15:24:43 +0100

"Kai Sommerfeld" said:

> The missing functions are available in ws2_32.lib. This lib is missing
> in the respective sections of Makefile.vc6. Adding ws2_32.lib fixes the
> unresolved externals.

libcurl.dll uses wsock32.lib to be compatible with old Win-9x systems
AFAICR.

> BUT... after having done this I noticed that the produced libcurl.dll
> will work fine on Windows XP but can't even be loaded on Windows 2000.
> getaddrinfo and other functions cannot be found in ws2_32.dll.

IPv6 for Win-2000 is only available via the IPv6 Technology Preview, right? So
doesn't this include an updated ws2_32.dll? Or is getaddrinfo in wship6.dll?
Check with depends or pedump.

If getaddrinfo() is in wship6.dll, one should use the WspiapiLoad() hack in
<wspiapi.h>. I don't know since I've never tried W2K.

> #if (defined(ENABLE_IPV6) || defined(CURLDEBUG)) && defined(_MSC_VER) && \
> (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0500)
> /*
> * Needed to pull in the real getaddrinfo() and not the inline version
> * in <wspiAPI.H> which doesn't support IPv6 (IPv4 only). <wspiAPI.H> is
> * included from <ws2tcpip.h> for <= 0x0500 SDKs.
> */
> #undef _WIN32_WINNT
> #define _WIN32_WINNT 0x0501
> #endif
>
> Giving this, I'm wondering what the code in setup.h is actually good
> for. Shouldn't it just be removed? I'd see no problems with this.

I don't remember the exact reason for it now (link fail?). But I noted it would
fall back to WspiapiLegacyGetAddrInfo() which is IPv4 only. If you get it working
on Win-2K by changing/removing _WIN32_WINNT, it's probably the right thing.

--gv
Received on 2005-01-04