diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-14 09:49:44 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-14 09:49:44 (GMT) |
commit | b4121d824b8f8453db88d4e9a05e141ee7c6acb9 (patch) | |
tree | aecc12ce20b5147adc55d7ba51ae8c4257d3ab05 /src/main.c | |
parent | abcaa6d33f1a993b3e07b66889d86b44700b7c14 (diff) | |
download | soup-transcoding-proxy-b4121d824b8f8453db88d4e9a05e141ee7c6acb9.zip soup-transcoding-proxy-b4121d824b8f8453db88d4e9a05e141ee7c6acb9.tar.gz |
server: Fix cleanup of clients
On forced server abort, as well as normal exit
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -348,9 +348,10 @@ GET: gst_pad_add_probe (srcpad, GST_PAD_PROBE_TYPE_BLOCK, (GstPadProbeCallback) tee_src_pad_blocked_cb, client_ctx, NULL); + gst_object_unref (template); gst_object_unref (srcpad); + gst_object_unref (tee); - gst_object_ref (appsink); client_ctx->appsink = appsink; g_signal_connect (appsink, "new-sample", @@ -399,7 +400,7 @@ got_request_body_chunk (SoupMessage *msg, if (ret != GST_FLOW_OK) { g_critical ("Unable to push buffer\n"); soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR); - stp_cleanup_transcode_server_ctx (ctx); + g_hash_table_remove (ctx->parent_ctx_table, ctx->path); return; } } @@ -449,7 +450,7 @@ got_first_request_body_chunk (SoupMessage *msg, GST_STATE_CHANGE_FAILURE) { g_critical ("Unable to set pipeline to PLAYING\n"); soup_message_set_status (msg, SOUP_STATUS_INTERNAL_SERVER_ERROR); - stp_cleanup_transcode_server_ctx (ctx); + g_hash_table_remove (ctx->parent_ctx_table, ctx->path); } else { g_print ("Set pipeline to PLAYING\n"); } @@ -605,10 +606,10 @@ GET: { if (!server_ctx->stream_finished) { /* Close the PUT stream if necessary */ server_ctx->stream_finished = TRUE; - soup_message_set_status (server_ctx->msg, SOUP_STATUS_OK); + soup_message_set_status (server_ctx->msg, SOUP_STATUS_GONE); } /* Disconnect all clients, and shut down the stream */ - stp_cleanup_transcode_server_ctx (server_ctx); + g_hash_table_remove (ctx_table, server_ctx->path); soup_message_set_status (msg, SOUP_STATUS_OK); goto out; } |