diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-23 21:51:50 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-23 21:51:50 (GMT) |
commit | d6044621bfa82debbb70f3609d08b69badac36c2 (patch) | |
tree | e41b823bc83a0111085ebb3d66c7cce3dac1329c /src/lib.c | |
parent | 478b78c77e32612d84f2bfa7cc7dcc70ed59d5fb (diff) | |
download | soup-transcoding-proxy-d6044621bfa82debbb70f3609d08b69badac36c2.zip soup-transcoding-proxy-d6044621bfa82debbb70f3609d08b69badac36c2.tar.gz |
server: Track stream state better, and abort better
We now differentiate between STREAMING, FLUSHING, and FINISHED. Server aborting
is now consolidated into a single function that's called from everywhere.
Diffstat (limited to 'src/lib.c')
-rw-r--r-- | src/lib.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -24,14 +24,14 @@ static void stp_disconnect_cleanup_client (TranscodeClientCtx *ctx); -static gboolean +gboolean invoke_g_hash_table_remove (TranscodeServerCtx *ctx) { g_hash_table_remove (ctx->parent_ctx_table, ctx->path); return G_SOURCE_REMOVE; } -static gboolean +gboolean invoke_g_free_client_context (TranscodeClientCtx *ctx) { g_free (ctx); @@ -56,7 +56,8 @@ stp_on_gst_bus_message (GstBus *bus, g_free (tmp); /* Setting the server response will only work if the request * hasn't already finished, so we check that */ - if (!ctx->stream_finished) + if (ctx->status == STP_STATUS_STREAMING && + ctx->encoding != SOUP_ENCODING_CONTENT_LENGTH) soup_message_set_status (ctx->msg, SOUP_STATUS_INTERNAL_SERVER_ERROR); /* Cleanup in the default main context, * because GHashTable is not thread-safe */ |