Ticket #429: Detect listenForIncomingConnectionsNoFork() function, conditionally compile listen support.

This commit is contained in:
Michael Jumper 2013-10-25 17:49:22 -07:00
parent 9e1ebb8362
commit 3a28534232
3 changed files with 38 additions and 1 deletions

View File

@ -230,6 +230,31 @@ then
fi
#
# Listening support within libVNCServer
#
if test "x${have_libvncserver}" = "xyes"
then
have_vnc_listen=yes
AC_CHECK_DECL([listenForIncomingConnectionsNoFork],
[], [have_vnc_listen=no],
[[#include <rfb/rfbclient.h>]])
if test "x${have_vnc_listen}" = "xno"
then
AC_MSG_WARN([
--------------------------------------------
No listening support found in libvncclient.
Support for listen-mode connections will not be built.
--------------------------------------------])
else
AC_DEFINE([ENABLE_VNC_LISTEN])
fi
fi
#
# FreeRDP
#

View File

@ -77,8 +77,11 @@ const char* GUAC_CLIENT_ARGS[] = {
"audio-servername",
#endif
#ifdef ENABLE_VNC_LISTEN
"reverse-connect",
"listen-timeout",
#endif
NULL
};
@ -104,8 +107,11 @@ enum VNC_ARGS_IDX {
IDX_AUDIO_SERVERNAME,
#endif
#ifdef ENABLE_VNC_LISTEN
IDX_REVERSE_CONNECT,
IDX_LISTEN_TIMEOUT,
#endif
VNC_ARGS_COUNT
};
@ -169,6 +175,7 @@ static rfbClient* __guac_vnc_get_client(guac_client* client) {
}
#endif
#ifdef ENABLE_VNC_LISTEN
/* If reverse connection enabled, start listening */
if (guac_client_data->reverse_connect) {
@ -182,6 +189,7 @@ static rfbClient* __guac_vnc_get_client(guac_client* client) {
return NULL;
}
#endif
/* Set encodings if provided */
if (guac_client_data->encodings)
@ -264,6 +272,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
else
retries_remaining = 0;
#ifdef ENABLE_VNC_LISTEN
/* Set reverse-connection flag */
guac_client_data->reverse_connect =
(strcmp(argv[IDX_REVERSE_CONNECT], "true") == 0);
@ -272,7 +281,8 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
if (argv[IDX_LISTEN_TIMEOUT][0] != '\0')
guac_client_data->listen_timeout = atoi(argv[IDX_LISTEN_TIMEOUT]);
else
guac_client_data->listen_timeout = 5000;
guac_client_data->listen_timeout = 5000;
#endif
/* Ensure connection is kept alive during lengthy connects */
guac_socket_require_keep_alive(client->socket);

View File

@ -134,6 +134,7 @@ typedef struct vnc_guac_client_data {
*/
int dest_port;
#ifdef ENABLE_VNC_LISTEN
/**
* Whether not actually connecting to a VNC server, but rather listening
* for a connection from the VNC server (reverse connection).
@ -145,6 +146,7 @@ typedef struct vnc_guac_client_data {
* milliseconds.
*/
int listen_timeout;
#endif
/**
* Whether the cursor should be rendered on the server (remote) or on the