Move to 0.7.0 client init.

This commit is contained in:
Michael Jumper 2012-08-29 11:32:19 -07:00
parent 34f2347316
commit 578f676b2f
2 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -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");