summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-07-15 17:50:51 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2014-07-15 17:50:51 (GMT)
commit507f8c8a73e2f373c2b50db6490688689fc88517 (patch)
treee69cd5fa0ae4a8f094c62a97e69bd26b5b55229f /src/main.c
parentd941945543dfd412813ea68dcab70fe57b8b8273 (diff)
downloadsoup-transcoding-proxy-507f8c8a73e2f373c2b50db6490688689fc88517.zip
soup-transcoding-proxy-507f8c8a73e2f373c2b50db6490688689fc88517.tar.gz
server: Make cleanup on server exit and EOS more reliable
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c
index 44b3201..3b9c243 100644
--- a/src/main.c
+++ b/src/main.c
@@ -178,10 +178,7 @@ client_finished_cb (SoupMessage *msg,
TranscodeClientCtx *ctx)
{
stp_print_status ("Client finished/aborted, doing cleanup...\n");
- /* Make sure not to double-free. If the server
- * has shut down, this will be 0. */
- if (ctx->timeout_handler_id)
- stp_cleanup_transcode_client_ctx (ctx);
+ stp_cleanup_transcode_client_ctx (ctx);
}
static void
@@ -344,8 +341,9 @@ nostreamheader:
G_CALLBACK (client_eos_cb), client_ctx);
g_signal_connect (client_ctx->msg, "wrote-chunk",
G_CALLBACK (can_write_next_client_chunk_cb), client_ctx);
- g_signal_connect (client_ctx->msg, "finished",
- G_CALLBACK (client_finished_cb), client_ctx);
+ client_ctx->finished_handler_id =
+ g_signal_connect (client_ctx->msg, "finished",
+ G_CALLBACK (client_finished_cb), client_ctx);
client_ctx->timeout_handler_id = \
g_timeout_add_seconds (2, (GSourceFunc)increment_write_timer, client_ctx);