summaryrefslogtreecommitdiff
path: root/response.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-07-19 15:50:56 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-07-19 15:50:56 -0400
commit36fa03dc7b96994a86db9fa7a51e8dd654c27b14 (patch)
tree89a4be257f65d94a8d8f77b0a3fd32c8e56f35ee /response.c
parent0fbcb784478e0be2fd7f31f79db45571fdbaef78 (diff)
change echo to a single multiline string
Diffstat (limited to 'response.c')
-rw-r--r--response.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/response.c b/response.c
index 6c93622..2321937 100644
--- a/response.c
+++ b/response.c
@@ -107,15 +107,18 @@ void echoCb(gpointer instance, GObject *arg1, gpointer user_data)
gssize written = 0;
gchar* upper = g_ascii_strup(str, len);
- int i;
-
- for(i=0; i<3; i++) {
- //send response back to client
- written = data->cb(stream, upper, len);
- if(written == -1) {
- g_print_debug("Could not send message to client\n");
- }
+
+ gchar *out_string = g_strdup_printf("%s\n%s\n%s\n",upper,upper,upper);
+ gssize out_len = strlen (out_string);
+
+ //send response back to client
+ written = data->cb(stream, out_string, out_len);
+ if(written == -1) {
+ g_print_debug("Could not send message to client\n");
}
+
g_free(upper);
+ g_free(out_string);
+
g_static_mutex_unlock (&mutex);
}