summaryrefslogtreecommitdiff
path: root/response.c
diff options
context:
space:
mode:
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);
}