diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-15 17:50:51 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-15 17:50:51 (GMT) |
commit | 507f8c8a73e2f373c2b50db6490688689fc88517 (patch) | |
tree | e69cd5fa0ae4a8f094c62a97e69bd26b5b55229f /src/main.c | |
parent | d941945543dfd412813ea68dcab70fe57b8b8273 (diff) | |
download | soup-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.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -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); |