Ticket #241: Added server-side support for vnc repeaters.

This commit is contained in:
James Muehlner 2013-07-01 10:46:30 -07:00
parent bfe28460a7
commit b94b84956b

View File

@ -57,6 +57,8 @@ const char* GUAC_CLIENT_ARGS[] = {
"password", "password",
"swap-red-blue", "swap-red-blue",
"color-depth", "color-depth",
"dest-host",
"dest-port",
NULL NULL
}; };
@ -76,7 +78,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
/*** PARSE ARGUMENTS ***/ /*** PARSE ARGUMENTS ***/
if (argc < 7) { if (argc < 9) {
guac_protocol_send_error(client->socket, "Wrong argument count received."); guac_protocol_send_error(client->socket, "Wrong argument count received.");
guac_socket_flush(client->socket); guac_socket_flush(client->socket);
return 1; return 1;
@ -131,6 +133,13 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
rfb_client->serverHost = strdup(argv[0]); rfb_client->serverHost = strdup(argv[0]);
rfb_client->serverPort = atoi(argv[1]); rfb_client->serverPort = atoi(argv[1]);
/* Set repeater parameters if specified */
if(argv[7][0] != '\0')
rfb_client->destHost = strdup(argv[7]);
if(argv[8][0] != '\0')
rfb_client->destPort = atoi(argv[8]);
/* Set encodings if specified */ /* Set encodings if specified */
if (argv[3][0] != '\0') if (argv[3][0] != '\0')
rfb_client->appData.encodingsString = guac_client_data->encodings = strdup(argv[3]); rfb_client->appData.encodingsString = guac_client_data->encodings = strdup(argv[3]);