[web] Fix libwebsocket 2.0 (Debian Buster) incompability added in commit 1a56255

This commit is contained in:
ejurgensen 2021-05-21 19:59:12 +02:00
parent e837de91e8
commit 28f8ff5253
1 changed files with 5 additions and 0 deletions

View File

@ -487,10 +487,15 @@ websocket_init(void)
info.port = websocket_port;
info.iface = websocket_interface;
info.protocols = protocols;
#ifdef LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY // Debian Buster's libwebsockets does not have this flag
if (cfg_getbool(cfg_getsec(cfg, "general"), "ipv6"))
info.options |= LWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY; // Assures dual stack is enabled by switching off IPV6_V6ONLY
else
info.options |= LWS_SERVER_OPTION_DISABLE_IPV6;
#else
if (!cfg_getbool(cfg_getsec(cfg, "general"), "ipv6"))
info.options |= LWS_SERVER_OPTION_DISABLE_IPV6;
#endif
info.gid = -1;
info.uid = -1;