summaryrefslogtreecommitdiff
path: root/response.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-13 17:53:08 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-13 17:53:08 -0400
commit92d5506d7fe5036999cca50d6b9b9cce3f29daff (patch)
tree485fde4af1b63e6bf42c3e746092cfc7543df440 /response.c
parent21f8e7cd6cc06e25f1a49c1cf2b26879150de38f (diff)
simplify output callback by calculating string size automatically
Diffstat (limited to 'response.c')
-rw-r--r--response.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/response.c b/response.c
index a597ea8..10cc941 100644
--- a/response.c
+++ b/response.c
@@ -15,7 +15,7 @@ extern GAsyncQueue* stdinQueue; //our queue
SignalObject* signalObject; //the signal object which registered the signal id
//write output to client
-static gssize writeOutput(GPollableOutputStream* stream, gchar* data, gssize size);
+static gssize writeOutput(GPollableOutputStream* stream, gchar* data);
//callback for client output, this is where the queue messages are sent to the client
gboolean cbClientOutput(gpointer data, gpointer additional)
@@ -89,9 +89,9 @@ gboolean cbClientInput(gpointer data, gpointer additional)
}
//write output to client
-static gssize writeOutput(GPollableOutputStream* stream, gchar* data, gssize size)
+static gssize writeOutput(GPollableOutputStream* stream, gchar* data)
{
- return g_pollable_output_stream_write_nonblocking(stream, data, size, NULL, NULL);
+ return g_pollable_output_stream_write_nonblocking(stream, data, strlen(data), NULL, NULL);
}
//initialize the signals
@@ -138,7 +138,7 @@ void responseCb(gpointer instance, GObject *arg1, gpointer user_data)
strcat(out, "\n");
}
- written = data->cb(stream, out, strlen(out));
+ written = data->cb(stream, out);
if (written == -1) {
g_print("Could not send message to client\n");
}