GUACAMOLE-623: Add configure test for LWS_CALLBACK_CLIENT_CLOSED (only defined in recent libwebsockets and required if present).

This commit is contained in:
Michael Jumper 2018-09-10 20:00:44 -07:00
parent ed56093888
commit c5f67a31dc
2 changed files with 10 additions and 1 deletions

View File

@ -1193,6 +1193,16 @@ then
[have_libwebsockets=no]) [have_libwebsockets=no])
fi 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 <libwebsockets.h>])
fi
AM_CONDITIONAL([ENABLE_WEBSOCKETS], AM_CONDITIONAL([ENABLE_WEBSOCKETS],
[test "x${have_libwebsockets}" = "xyes"]) [test "x${have_libwebsockets}" = "xyes"])

View File

@ -268,7 +268,6 @@ static int guac_kubernetes_lws_callback(struct lws* wsi,
lws_callback_on_writable(wsi); lws_callback_on_writable(wsi);
break; break;
/* TODO: Add configure test */
#ifdef HAVE_LWS_CALLBACK_CLIENT_CLOSED #ifdef HAVE_LWS_CALLBACK_CLIENT_CLOSED
/* Connection closed (client-specific) */ /* Connection closed (client-specific) */
case LWS_CALLBACK_CLIENT_CLOSED: case LWS_CALLBACK_CLIENT_CLOSED: