summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2015-05-28 20:17:39 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2015-05-28 20:17:45 (GMT)
commit8bfe8b28447fbbf8ff1cc4b1fec11bb92af6ef14 (patch)
treed8fa02717dfc3cd90e1db24812e40f824c400fdb /src
parentadcdf71a92f1ddf447795794c51fe3eba0e47c94 (diff)
downloadsoup-transcoding-proxy-8bfe8b28447fbbf8ff1cc4b1fec11bb92af6ef14.zip
soup-transcoding-proxy-8bfe8b28447fbbf8ff1cc4b1fec11bb92af6ef14.tar.gz
main.c: Fix double-free
The cleanup will be called when the pipeline goes EOS, so don't do it twice
Diffstat (limited to 'src')
-rw-r--r--src/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 715fd8b..420490c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -171,8 +171,6 @@ stp_abort_server_ctx (STPServerCtx *ctx)
soup_message_set_status (ctx->msg, SOUP_STATUS_GONE);
}
stream_finished_cb (ctx->msg, ctx);
- /* Disconnect all clients, and shut down the stream */
- invoke_g_hash_table_remove (ctx);
}
/* If it's been more than 5 seconds since the last time we got
@@ -310,7 +308,7 @@ stream_finished_cb (SoupMessage *msg,
}
ctx->status = STP_STATUS_FLUSHING;
- /* Incoming stream has ended */
+ /* Incoming stream has ended; this EOS will trigger a cleanup of ctx as well */
g_signal_emit_by_name (ctx->appsrc, "end-of-stream", &ret);
if (ret != GST_FLOW_OK)
g_critical ("\nUnable to emit end-of-stream after an aborted stream");
@@ -713,9 +711,9 @@ PUT: {
* of the previous one, so it's a conflict... unless the
* '--conflict-is-restart' option has been specified. */
if (conflict_is_restart) {
+ g_debug ("A connection already exists; forcing a restart");
ctx = get_server_ctx_from_msg (msg, tables->ctxs);
stream_finished_cb (ctx->msg, ctx);
- invoke_g_hash_table_remove (ctx);
goto new_conn;
}
g_critical ("Recv Content-Length PUT on '%s' without Content-Range", path);