diff --git a/configure.ac b/configure.ac index bb23f62c..672d19eb 100644 --- a/configure.ac +++ b/configure.ac @@ -1224,6 +1224,14 @@ then [Whether LCCSCF_USE_SSL is defined])],, [#include ]) + # Older versions of libwebsockets do not define a dummy callback which + # must be invoked after the main event callback is invoked; the main event + # callback must instead manually return zero + AC_CHECK_DECL([lws_callback_http_dummy], + [AC_DEFINE([HAVE_LWS_CALLBACK_HTTP_DUMMY],, + [Whether lws_callback_http_dummy() is defined])],, + [#include ]) + fi AM_CONDITIONAL([ENABLE_WEBSOCKETS], diff --git a/src/protocols/kubernetes/kubernetes.c b/src/protocols/kubernetes/kubernetes.c index 9cb0b13b..fb38d680 100644 --- a/src/protocols/kubernetes/kubernetes.c +++ b/src/protocols/kubernetes/kubernetes.c @@ -66,8 +66,13 @@ static int guac_kubernetes_lws_callback(struct lws* wsi, guac_client* client = guac_kubernetes_lws_current_client; /* Do not handle any further events if connection is closing */ - if (client->state != GUAC_CLIENT_RUNNING) + if (client->state != GUAC_CLIENT_RUNNING) { +#ifdef HAVE_LWS_CALLBACK_HTTP_DUMMY return lws_callback_http_dummy(wsi, reason, user, in, length); +#else + return 0; +#endif + } switch (reason) { @@ -127,7 +132,11 @@ static int guac_kubernetes_lws_callback(struct lws* wsi, } +#ifdef HAVE_LWS_CALLBACK_HTTP_DUMMY return lws_callback_http_dummy(wsi, reason, user, in, length); +#else + return 0; +#endif }