[Libwebsockets] compile failure (+socks5, -client)

Jaco Kroon jaco at uls.co.za
Mon Jan 6 11:36:00 CET 2020


Hi,

In lws_create_vhost (lib/core-net/vhost.c), using the v3.2.1 version:

 440 #if !defined(LWS_WITHOUT_CLIENT) && defined(LWS_HAVE_GETENV)
 441     char *p;
 442 #endif

Then later on:

 705 #if defined(LWS_WITH_SOCKS5)
 706     /* socks proxy */
 707     if (info->socks_proxy_address) {
 708         /* override for backwards compatibility */
 709         if (info->socks_proxy_port)
 710             vh->socks_proxy_port = info->socks_proxy_port;
 711         lws_set_socks(vh, info->socks_proxy_address);
 712     } else {
 713 #ifdef LWS_HAVE_GETENV
 714         p = getenv("socks_proxy");
 715         if (p && strlen(p) > 0 && strlen(p) < 95)
 716             lws_set_socks(vh, p);
 717 #endif
 718     }
 719 #endif

So the define needs to be (!defined(LWS_WITHOUT_CLIENT) || defined
(LWS_WITH_SOCKS5)) && defined(LWS_HAVE_GETENV).

master looks a bit different, but I think will suffer the same issue
based on the same:

 453 #if defined(LWS_CLIENT_HTTP_PROXYING) && \
 454     defined(LWS_WITH_CLIENT) && defined(LWS_HAVE_GETENV)
 455     char *p;
 456 #endif

and:

 737 #if defined(LWS_WITH_SOCKS5)
 738     /* socks proxy */
 739     if (info->socks_proxy_address) {
 740         /* override for backwards compatibility */
 741         if (info->socks_proxy_port)
 742             vh->socks_proxy_port = info->socks_proxy_port;
 743         lws_set_socks(vh, info->socks_proxy_address);
 744     } else {
 745 #ifdef LWS_HAVE_GETENV
 746         p = getenv("socks_proxy");
 747         if (p && strlen(p) > 0 && strlen(p) < 95)
 748             lws_set_socks(vh, p);
 749 #endif
 750     }
 751 #endif

There are however other compile failures on master too in lib/core/vfs.c
in same config which I don't have time to trouble-shoot right now (and
doesn't affect me at the moment).

I've created PRs on github for you for both patches too.

This was picked up by Gentoo's tinderbox:  https://bugs.gentoo.org/704180

Kind Regards,
Jaco

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v3.2.1-0001-lws_create_vhost-compile-failure-with-SOCKS5-client.patch
Type: text/x-patch
Size: 949 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200106/e2a5b6ec/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: master-0001-core-net-vhost-Compile-errors-with-SOCKS5-but-WITHOU.patch
Type: text/x-patch
Size: 963 bytes
Desc: not available
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200106/e2a5b6ec/attachment-0001.bin>


More information about the Libwebsockets mailing list