diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-14 16:44:01 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-14 16:44:01 (GMT) |
commit | 54742d00a169b5e5469b00eb9ad66685bb4d2e42 (patch) | |
tree | 144542449a8842d760c793299a1d9dab74bdba9b /src/main.c | |
parent | e24395dd55d601211c27646b4ebde4e95fda72af (diff) | |
download | soup-transcoding-proxy-54742d00a169b5e5469b00eb9ad66685bb4d2e42.zip soup-transcoding-proxy-54742d00a169b5e5469b00eb9ad66685bb4d2e42.tar.gz |
debug: Remove extra newlines, and use g_critical everywhere
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 50 |
1 files changed, 25 insertions, 25 deletions
@@ -96,7 +96,7 @@ static void client_eos_cb (GstElement *appsink, TranscodeClientCtx *ctx) { - g_debug ("Received EOS for client\n"); + g_debug ("Received EOS for client"); soup_message_set_status (ctx->msg, SOUP_STATUS_OK); soup_message_body_complete (ctx->msg->response_body); } @@ -121,7 +121,7 @@ invoke_write_client_chunk (TranscodeClientCtx *ctx) stp_print_status ("*"); g_signal_emit_by_name (ctx->appsink, "pull-sample", &sample); if (!sample) { - g_debug ("Null sample, ending stream\n"); + g_debug ("Null sample, ending stream"); g_object_get (ctx->appsink, "eos", &eos, NULL); if (eos) soup_message_set_status (ctx->msg, SOUP_STATUS_OK); @@ -178,7 +178,7 @@ stream_finished_cb (SoupMessage *msg, /* Incoming stream has ended */ g_signal_emit_by_name (ctx->appsrc, "end-of-stream", &ret); if (ret != GST_FLOW_OK) - g_printerr ("\nUnable to emit end-of-stream after an aborted stream\n"); + g_critical ("\nUnable to emit end-of-stream after an aborted stream"); else stp_print_status ("Done.\n"); } @@ -197,7 +197,7 @@ handle_request_cb (SoupServer *server, if (!msg) return; - g_debug ("Handling %s request on path %s\n", msg->method, path); + g_debug ("Handling %s request on path %s", msg->method, path); if (msg->method == SOUP_METHOD_PUT || msg->method == SOUP_METHOD_POST) @@ -297,7 +297,7 @@ GET: goto err; } - g_debug ("appsink bin state synced successfully\n"); + g_debug ("appsink bin state synced successfully"); /* t. ! queue ! appsink */ gst_pad_link (srcpad, client_ctx->ghostsinkpad); @@ -308,13 +308,13 @@ GET: /* TODO: cache keyframes */ buffer = stp_get_streamheader_from_caps (caps); if (!buffer) { - g_printerr ("Unable to get streamheader from caps\n"); + g_critical ("Unable to get streamheader from caps"); goto push_keyframe; } ret = gst_pad_push (srcpad, buffer); if (ret != GST_FLOW_OK) { - g_printerr ("Unable to push streamheader: %s\n", + g_critical ("Unable to push streamheader: %s", gst_flow_get_name (ret)); goto err; } @@ -323,14 +323,14 @@ push_keyframe: ret = gst_pad_push_list (srcpad, gst_buffer_list_copy (server_ctx->keyframe)); if (ret != GST_FLOW_OK) { - g_printerr ("Unable to push keyframe data: %s\n", + g_critical ("Unable to push keyframe data: %s", gst_flow_get_name (ret)); goto err; } state_change = gst_element_get_state (server_ctx->pipeline, &state, NULL, 1); - g_debug ("Pushed buffer. State was %s:%s.\n", + g_debug ("Pushed buffer. State was %s:%s.", gst_element_state_change_return_get_name (state_change), gst_element_state_get_name (state)); @@ -404,7 +404,7 @@ static void request_ended_no_body_cb (SoupMessage *msg, TranscodeServerCtx *ctx) { - g_printerr ("Request ended without a body!\n"); + g_critical ("Request ended without a body!"); g_hash_table_remove (ctx->parent_ctx_table, ctx->path); g_free (ctx); } @@ -447,7 +447,7 @@ got_first_request_body_chunk (SoupMessage *msg, soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR); g_hash_table_remove (ctx->parent_ctx_table, ctx->path); } else { - g_debug ("Set pipeline to PLAYING\n"); + g_debug ("Set pipeline to PLAYING"); } /* Connect a different method for all further chunks */ @@ -475,11 +475,11 @@ got_request_headers (SoupMessage *msg, const char *name, *value; soup_message_headers_iter_init (&iter, msg->request_headers); while (soup_message_headers_iter_next (&iter, &name, &value)) - g_debug ("%s: %s\n", name, value); + g_debug ("%s: %s", name, value); #endif g_object_get (msg, "uri", &uri, NULL); - g_debug ("%s on uri %s\n", msg->method, soup_uri_get_path (uri)); + g_debug ("%s on uri %s", msg->method, soup_uri_get_path (uri)); if (msg->method == SOUP_METHOD_PUT || msg->method == SOUP_METHOD_POST) @@ -508,17 +508,17 @@ PUT: { encoding = soup_message_headers_get_encoding (msg->request_headers); switch (encoding) { case SOUP_ENCODING_CHUNKED: - g_debug ("Chunked encoding detected!\n"); + g_debug ("Chunked encoding detected!"); if (connection_exists) { /* There's already a chunked request streaming on this path */ - g_printerr ("Recv duplicate request on the same URI: %s\n", - soup_uri_get_path (uri)); + g_critical ("Recv duplicate request on the same URI: %s", + soup_uri_get_path (uri)); soup_message_set_status (msg, SOUP_STATUS_CONFLICT); goto out; } break; case SOUP_ENCODING_CONTENT_LENGTH: - g_debug ("Content-Length encoding detected!\n"); + g_debug ("Content-Length encoding detected!"); content_range = soup_message_headers_get_one (msg->request_headers, "Content-Range"); /* TODO: Right now, we don't check if the Content-Range is valid, @@ -526,7 +526,7 @@ PUT: { if (connection_exists && !content_range) { /* A connection already exists, and this one isn't a continuation * of the previous one, so it's a conflict */ - g_printerr ("Recv Content-Length PUT on '%s' without Content-Range\n", + g_critical ("Recv Content-Length PUT on '%s' without Content-Range", soup_uri_get_path (uri)); soup_message_set_status (msg, SOUP_STATUS_CONFLICT); goto out; @@ -548,10 +548,10 @@ PUT: { soup_message_body_set_accumulate (msg->request_body, FALSE); if (connection_exists) { - g_debug ("Stream already exists, connecting everything to that...\n"); + g_debug ("Stream already exists, connecting everything to that..."); ctx = get_server_ctx_from_msg (msg, ctx_table); if (ctx->stream_finished) { - g_printerr ("Recv more data on '%s' after timeout\n", + g_critical ("Recv more data on '%s' after timeout", soup_uri_get_path (uri)); soup_message_set_status (msg, SOUP_STATUS_REQUEST_TIMEOUT); goto out; @@ -588,7 +588,7 @@ GET: { if (!g_hash_table_contains (ctx_table, soup_uri_get_path (uri))) { - g_printerr ("No stream on URI: %s\n", soup_uri_get_path (uri)); + g_critical ("No stream on URI: %s", soup_uri_get_path (uri)); soup_message_set_status (msg, SOUP_STATUS_NOT_FOUND); goto out; } @@ -627,7 +627,7 @@ request_started_cb (SoupServer *server, SoupClientContext *client, GHashTable *ctx_table) { - g_debug ("New %s request started\n", msg->method); + g_debug ("New %s request started", msg->method); /* SoupMessage is useful only once we have headers, * so we do all initialization there */ @@ -661,7 +661,7 @@ GET: /* Nothing to do */ } - g_debug ("%s request read successfully\n", msg->method); + g_debug ("%s request read successfully", msg->method); } static void @@ -670,7 +670,7 @@ request_finished_cb (SoupServer *server, SoupClientContext *client, GHashTable *ctx_table) { - g_debug ("%s request ended\n", msg->method); + g_debug ("%s request ended", msg->method); } static void @@ -679,7 +679,7 @@ request_aborted_cb (SoupServer *server, SoupClientContext *client, GHashTable *ctx_table) { - g_debug ("%s request aborted!\n", msg->method); + g_debug ("%s request aborted!", msg->method); if (msg->method == SOUP_METHOD_PUT || msg->method == SOUP_METHOD_POST) goto PUT; |