From d76389340cc470e8e4c20c40780ff18e39667aee Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 10 Jul 2025 16:37:00 +0100 Subject: [PATCH] Fix build variant workflow Note that WITH_TLS fails because websockets requires TLS, and WITH_SHARED_LIBRARIES fails because with it turned off none of the libraries are built --- buildtest.py | 5 +++-- src/mosquitto_broker_internal.h | 4 +++- src/proxy_v1.c | 5 ++++- src/proxy_v2.c | 5 ++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/buildtest.py b/buildtest.py index 811f15c1..4bf4bb11 100755 --- a/buildtest.py +++ b/buildtest.py @@ -7,10 +7,11 @@ build_variants = [ 'WITH_CONTROL', 'WITH_EDITLINE', 'WITH_EPOLL', + 'WITH_HTTP_API', 'WITH_MEMORY_TRACKING', 'WITH_OLD_KEEPALIVE', 'WITH_PERSISTENCE', - 'WITH_SHARED_LIBRARIES', + #'WITH_SHARED_LIBRARIES', 'WITH_SOCKS', 'WITH_SQLITE', 'WITH_SRV', @@ -18,7 +19,7 @@ build_variants = [ 'WITH_SYSTEMD', 'WITH_SYS_TREE', 'WITH_THREADING', - 'WITH_TLS', + #'WITH_TLS', 'WITH_TLS_PSK', 'WITH_UNIX_SOCKETS', 'WITH_WEBSOCKETS', diff --git a/src/mosquitto_broker_internal.h b/src/mosquitto_broker_internal.h index 99c763e2..d007a49f 100644 --- a/src/mosquitto_broker_internal.h +++ b/src/mosquitto_broker_internal.h @@ -264,9 +264,11 @@ struct mosquitto__listener { bool ws_in_init; struct lws_protocols *ws_protocol; # endif - char *http_dir; char **ws_origins; int ws_origin_count; +#endif +#if defined(WITH_WEBSOCKETS) || defined(WITH_HTTP_API) + char *http_dir; #endif struct mosquitto__security_options *security_options; #ifdef WITH_UNIX_SOCKETS diff --git a/src/proxy_v1.c b/src/proxy_v1.c index 68e10414..357aa74a 100644 --- a/src/proxy_v1.c +++ b/src/proxy_v1.c @@ -25,9 +25,12 @@ static void proxy_cleanup(struct mosquitto *context) static int update_transport(struct mosquitto *context) { +#if defined(WITH_WEBSOCKETS) && WITH_WEBSOCKETS == WS_IS_BUILTIN if(context->listener->protocol == mp_websockets){ return http__context_init(context); - }else{ + }else +#endif + { context->transport = mosq_t_tcp; } return MOSQ_ERR_SUCCESS; diff --git a/src/proxy_v2.c b/src/proxy_v2.c index 0cb7e812..a0d659c3 100644 --- a/src/proxy_v2.c +++ b/src/proxy_v2.c @@ -297,9 +297,12 @@ int proxy_v2__read(struct mosquitto *context) } proxy_cleanup(context); +#if defined(WITH_WEBSOCKETS) && WITH_WEBSOCKETS == WS_IS_BUILTIN if(context->listener->protocol == mp_websockets){ return http__context_init(context); - }else{ + }else +#endif + { context->transport = mosq_t_tcp; } }