GUACAMOLE-414: Use configure checks for finding TLS locking support.

This commit is contained in:
Nick Couchman 2019-03-10 15:22:49 -04:00
parent c90c057e12
commit df4c93b3e8
3 changed files with 31 additions and 4 deletions

View File

@ -512,6 +512,33 @@ then
fi
#
# TLS Locking Support within libVNCServer
#
if test "x${have_libvncserver}" = "xyes"
then
have_vnc_tls_locking=yes
AC_CHECK_MEMBERS([rfbClient.LockWriteToTLS, rfbClient.UnlockWriteToTLS],
[], [have_vnc_tls_locking=no],
[[#include <rfb/rfbclient.h>]])
if test "x${have_vnc_tls_locking}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
This version of libvncclient lacks support
for TLS locking. VNC connections that use
TLS may experience instability as documented
in GUACAMOLE-414])
else
AC_DEFINE([ENABLE_VNC_TLS_LOCKING],,
[Whether support for TLS locking within VNC is enabled.])
fi
fi
#
# FreeRDP
#

View File

@ -56,7 +56,7 @@
char* GUAC_VNC_CLIENT_KEY = "GUAC_VNC";
#if LIBVNCSERVER_VERSION_MAJOR >=0 && LIBVNCSERVER_VERSION_MINOR >= 9 && LIBVNCSERVER_VERSION_PATCHLEVEL >= 11
#ifdef ENABLE_VNC_TLS_LOCKING
/**
* A callback function that is called by the VNC library prior to writing
* data to a TLS-encrypted socket. This returns the rfbBool FALSE value
@ -127,7 +127,7 @@ rfbClient* guac_vnc_get_client(guac_client* client) {
rfb_client->GotFrameBufferUpdate = guac_vnc_update;
rfb_client->GotCopyRect = guac_vnc_copyrect;
#if LIBVNCSERVER_VERSION_MAJOR >=0 && LIBVNCSERVER_VERSION_MINOR >= 9 && LIBVNCSERVER_VERSION_PATCHLEVEL >= 11
#ifdef ENABLE_VNC_TLS_LOCKING
/* TLS Locking and Unlocking */
rfb_client->LockWriteToTLS = guac_vnc_lock_write_to_tls;
rfb_client->UnlockWriteToTLS = guac_vnc_unlock_write_to_tls;
@ -247,7 +247,7 @@ void* guac_vnc_client_thread(void* data) {
rfbClientLog = guac_vnc_client_log_info;
rfbClientErr = guac_vnc_client_log_error;
#if LIBVNCSERVER_VERSION_MAJOR >=0 && LIBVNCSERVER_VERSION_MINOR >= 9 && LIBVNCSERVER_VERSION_PATCHLEVEL >= 11
#ifdef ENABLE_VNC_TLS_LOCKING
/* Initialize the write lock */
pthread_mutex_init(&(vnc_client->tls_lock), NULL);
#endif

View File

@ -56,7 +56,7 @@ typedef struct guac_vnc_client {
*/
pthread_t client_thread;
#if LIBVNCSERVER_VERSION_MAJOR >=0 && LIBVNCSERVER_VERSION_MINOR >= 9 && LIBVNCSERVER_VERSION_PATCHLEVEL >= 11
#ifdef ENABLE_VNC_TLS_LOCKING
/**
* The TLS mutex lock for the client.
*/