From c5f67a31dc6c803da23f70662befc102a9187855 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 10 Sep 2018 20:00:44 -0700 Subject: [PATCH] GUACAMOLE-623: Add configure test for LWS_CALLBACK_CLIENT_CLOSED (only defined in recent libwebsockets and required if present). --- configure.ac | 10 ++++++++++ src/protocols/kubernetes/kubernetes.c | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ae783244..7c0bb73c 100644 --- a/configure.ac +++ b/configure.ac @@ -1193,6 +1193,16 @@ then [have_libwebsockets=no]) fi +# Check for client-specific closed event, which must be used in favor of the +# generic closed event if libwebsockets is recent enough to provide this +if test "x$with_websockets" != "xno" +then + AC_CHECK_DECL([LWS_CALLBACK_CLIENT_CLOSED], + [AC_DEFINE([HAVE_LWS_CALLBACK_CLIENT_CLOSED],, + [Whether LWS_CALLBACK_CLIENT_CLOSED is defined])],, + [#include ]) +fi + AM_CONDITIONAL([ENABLE_WEBSOCKETS], [test "x${have_libwebsockets}" = "xyes"]) diff --git a/src/protocols/kubernetes/kubernetes.c b/src/protocols/kubernetes/kubernetes.c index 380d1d3b..9850c6d4 100644 --- a/src/protocols/kubernetes/kubernetes.c +++ b/src/protocols/kubernetes/kubernetes.c @@ -268,7 +268,6 @@ static int guac_kubernetes_lws_callback(struct lws* wsi, lws_callback_on_writable(wsi); break; - /* TODO: Add configure test */ #ifdef HAVE_LWS_CALLBACK_CLIENT_CLOSED /* Connection closed (client-specific) */ case LWS_CALLBACK_CLIENT_CLOSED: