From f9f37a7a486facc3bc5ea430fa0f9e5c0a340635 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 18 Oct 2023 11:32:24 -0400 Subject: [PATCH] websock: compatibility for LWS without plugins --- src/websock/Webserver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/websock/Webserver.cpp b/src/websock/Webserver.cpp index 949cef16..24594c4f 100644 --- a/src/websock/Webserver.cpp +++ b/src/websock/Webserver.cpp @@ -724,9 +724,13 @@ namespace xo { */ void init_cx_config(lws_context_creation_info * p_cx_config) { ::memset(p_cx_config, 0, sizeof(*p_cx_config)); - p_cx_config->port = this->ws_config_.port(); + p_cx_config->port = this->ws_config_.port(); p_cx_config->vhost_name = "localhost"; - p_cx_config->pvo = &(this->pvo_); +#if defined(LWS_WITH_PLUGINS) + p_cx_config->pvo = &(this->pvo_); +#else + p_cx_config->pvo = nullptr; +#endif p_cx_config->protocols = this->protocol_v_.data(); p_cx_config->mounts = &(this->mount_static_); /* userdata -- accessible from context with lws_context_user() */