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

Andy Green andy at warmcat.com
Mon Jan 6 21:05:26 CET 2020



On 1/6/20 10:36 AM, Jaco Kroon wrote:
> 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

Thanks, I pushed the patches... there are a lot of build options in lws, 
it's not possible to test all the combinations.

I test what I consider the major sets of functionality in travis, there 
are 17 tests done once on Linux and once on OSX

     - LWS_METHOD=lwsws CMAKE_ARGS="-DLWS_WITH_LWSWS=ON 
-DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_HTTP2=1 -DLWS_WITH_ACME=1 
-DLWS_WITH_MINIMAL_EXAMPLES=1 -DCMAKE_BUILD_TYPE=DEBUG 
-DLWS_WITH_GENCRYPTO=1 -DLWS_WITH_JOSE=1 -DLWS_WITH_SYS_ASYNC_DNS=1 
-DLWS_WITH_SYS_NTPCLIENT=1"
     - LWS_METHOD=lwsws2 CMAKE_ARGS="-DLWS_WITH_LWSWS=ON 
-DLWS_WITHOUT_EXTENSIONS=0 -DLWS_WITH_HTTP2=1 -DLWS_WITH_ACME=1 
-DLWS_WITH_MINIMAL_EXAMPLES=1 -DCMAKE_BUILD_TYPE=DEBUG -DLWS_WITH_LWS_DSH=1"
     - LWS_METHOD=default CMAKE_ARGS="-DLWS_WITH_MINIMAL_EXAMPLES=1"
     - LWS_METHOD=mbedtls CMAKE_ARGS="-DLWS_WITH_MBEDTLS=1 
-DLWS_WITH_HTTP2=1 -DLWS_WITH_LWSWS=1 -DLWS_WITH_MINIMAL_EXAMPLES=1 
-DLWS_WITH_JOSE=1 -DCMAKE_BUILD_TYPE=DEBUG"
     - LWS_METHOD=noserver CMAKE_ARGS="-DLWS_WITHOUT_SERVER=ON 
-DLWS_WITH_MINIMAL_EXAMPLES=1"
     - LWS_METHOD=noclient CMAKE_ARGS="-DLWS_WITHOUT_CLIENT=ON 
-DLWS_WITH_MINIMAL_EXAMPLES=1"
     - LWS_METHOD=noext CMAKE_ARGS="-DLWS_WITHOUT_EXTENSIONS=ON 
-DLWS_WITH_MINIMAL_EXAMPLES=1"
     - LWS_METHOD=nonetwork CMAKE_ARGS="-DLWS_WITH_NETWORK=0"
     - LWS_METHOD=libev CMAKE_ARGS="-DLWS_WITH_LIBEV=ON"
     - LWS_METHOD=ipv6 CMAKE_ARGS="-DLWS_IPV6=ON"
     - LWS_METHOD=nossl CMAKE_ARGS="-DLWS_WITH_SSL=OFF"
     - LWS_METHOD=nodaemon CMAKE_ARGS="-DLWS_WITHOUT_DAEMONIZE=ON"
     - LWS_METHOD=cgi CMAKE_ARGS="-DLWS_WITH_CGI=ON"
     - LWS_METHOD=nologs CMAKE_ARGS="-DLWS_WITH_NO_LOGS=ON"
     - LWS_METHOD=smp CMAKE_ARGS="-DLWS_MAX_SMP=32 
-DLWS_WITH_MINIMAL_EXAMPLES=1"
     - LWS_METHOD=nows CMAKE_ARGS="-DLWS_ROLE_WS=0"
     - LWS_METHOD=threadpool CMAKE_ARGS="-DLWS_WITH_THREADPOOL=1 
-DLWS_WITH_MINIMAL_EXAMPLES=1"

That might not seem like much of a dent in however-many-thousands of 
combinations are possible, but just being forced to take care of 
WITHOUT_CLIENT, WITHOUT_SERVER, WITH_NETWORK=0 every push is actually 
quite effective in stopping huge areas of the real problem space from 
making trouble.  WITH_MINIMAL_EXAMPLES means all the examples get tested 
against those combinations as well.

-Andy

> Kind Regards,
> Jaco
> 
> 
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets
> 


More information about the Libwebsockets mailing list