From 9c7db46be9933e36e79b4caac86a5bdc3183122d Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 26 Aug 2010 22:36:07 +0200 Subject: Merged commands.c and control_commands.c. --- control_service.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'control_service.c') diff --git a/control_service.c b/control_service.c index 1dca7a9..150db6d 100644 --- a/control_service.c +++ b/control_service.c @@ -1,11 +1,12 @@ #include "control_service.h" -#include "control_commands.h" +#include "commands.h" #include "conf.h" #include #include #include #include +#include static GSocketService *ss = NULL; static GSocketAddress *address; @@ -13,6 +14,7 @@ static GSocketAddress *address; static gboolean service_incoming(GSocketService *service, GSocketConnection *connection, GObject *source_object, gpointer user_data) { + GError *error = NULL; g_debug("local service got incoming connection"); GSocket *socket = g_socket_connection_get_socket(connection); @@ -30,7 +32,16 @@ static gboolean service_incoming(GSocketService *service, } *pos = '\0'; - control_commands_handle(connection, buffer); + commands_handle(connection, buffer, &error); + + if(error != NULL) { + g_warning(error->message); + gchar *error_buffer = g_strdup_printf("%s\n", error->message); + g_socket_send(socket, error_buffer, strlen(error_buffer), NULL, NULL); + g_free(error_buffer); + g_error_free(error); + error = NULL; + } } return FALSE; -- cgit v1.2.3