summaryrefslogtreecommitdiff
path: root/src/lib.c
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-07-23 21:51:50 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2014-07-23 21:51:50 (GMT)
commitd6044621bfa82debbb70f3609d08b69badac36c2 (patch)
treee41b823bc83a0111085ebb3d66c7cce3dac1329c /src/lib.c
parent478b78c77e32612d84f2bfa7cc7dcc70ed59d5fb (diff)
downloadsoup-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib.c b/src/lib.c
index 019b4f7..868e060 100644
--- a/src/lib.c
+++ b/src/lib.c
@@ -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 */