diff options
-rw-r--r-- | response.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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); } |