From 578f676b2fc63f5574b11847f2fd9db703d2ab4d Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Wed, 29 Aug 2012 11:32:19 -0700 Subject: [PATCH] Move to 0.7.0 client init. --- guacd/configure.in | 2 +- guacd/src/daemon.c | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/guacd/configure.in b/guacd/configure.in index 64df74c9..9331367c 100644 --- a/guacd/configure.in +++ b/guacd/configure.in @@ -35,7 +35,7 @@ # ***** END LICENSE BLOCK ***** AC_INIT(src/daemon.c) -AM_INIT_AUTOMAKE(guacd, 0.6.2) +AM_INIT_AUTOMAKE(guacd, 0.7.0) # Checks for programs. AC_PROG_CC diff --git a/guacd/src/daemon.c b/guacd/src/daemon.c index 7dcc1d46..81971d97 100644 --- a/guacd/src/daemon.c +++ b/guacd/src/daemon.c @@ -70,6 +70,7 @@ void guacd_handle_connection(int fd) { guac_client_plugin* plugin; guac_instruction* select; guac_instruction* connect; + int init_result; /* Open guac_socket */ guac_socket* socket = guac_socket_open(fd); @@ -144,14 +145,22 @@ void guacd_handle_connection(int fd) { return; } - /* Load and init client */ - client = guac_client_plugin_get_client(plugin, socket, - connect->argc, connect->argv, - guacd_client_log_info, guacd_client_log_error); + /* Get client */ + client = guac_client_alloc(); + client->socket = socket; + client->log_info_handler = guacd_client_log_info; + client->log_error_handler = guacd_client_log_error; + + /* Init client */ + init_result = + guac_client_init(client, plugin, connect->argc, connect->argv); guac_instruction_free(connect); - if (client == NULL) { + /* If client could not be started, free everything and fail */ + if (init_result) { + + guac_client_free(client); guacd_log_guac_error("Error instantiating client");