diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-28 07:09:24 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-28 07:09:24 (GMT) |
commit | 4213deee2a1a312435c008c506f464a994bcc00e (patch) | |
tree | 8959053de0a15d3d62c527c8f23384c41579690c /src | |
parent | 06a53c87bf2870967ced8af0b32927dfbd7363ca (diff) | |
download | soup-transcoding-proxy-4213deee2a1a312435c008c506f464a994bcc00e.zip soup-transcoding-proxy-4213deee2a1a312435c008c506f464a994bcc00e.tar.gz |
misc: Fix some leaks, and remove an unnecessary print
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -169,7 +169,7 @@ increment_read_timer (STPServerCtx *ctx) if (ctx->seconds_since_read < server_timeout) return G_SOURCE_CONTINUE; - g_printerr ("Stream timed out, sending EOS\n"); + g_debug ("Stream timed out, sending EOS\n"); stream_finished_cb (ctx->msg, ctx); return G_SOURCE_REMOVE; } @@ -733,16 +733,14 @@ PUT: { /* The chunks we'll get are a continuation of the previous one */ g_signal_connect (msg, "got-chunk", G_CALLBACK (got_request_body_chunk), ctx); - PUT_out: - stp_stream_token_free (token); - goto out; + goto PUT_out; } /* This is a new connection; treat it as such */ ctx = g_new0 (STPServerCtx, 1); ctx->stream_type = token->stream_type; if (ctx->stream_type & STP_STREAM_TYPE_RTP_UDP) - ctx->udp_clients = token->udp_clients; + ctx->udp_clients = g_strdup (token->udp_clients); ctx->msg = msg; ctx->encoding = encoding; ctx->status = STP_STATUS_STREAMING; @@ -760,6 +758,8 @@ PUT: { if (encoding == SOUP_ENCODING_CONTENT_LENGTH) ctx->timeout_handler_id = g_timeout_add_seconds (2, (GSourceFunc)increment_read_timer, ctx); + PUT_out: + stp_stream_token_free (token); goto out; } @@ -1142,6 +1142,7 @@ gboolean exit_on_signal_cb (SoupServer *server) { soup_server_quit (server); + g_object_unref (server); return G_SOURCE_REMOVE; } @@ -1225,5 +1226,9 @@ main (int argc, g_unix_signal_add (SIGINT, (GSourceFunc)exit_on_signal_cb, server); soup_server_run (server); + + g_hash_table_unref (tables->tokens); + g_hash_table_unref (tables->ctxs); + g_free (tables); return 0; } |