From 74b8da93969b4462ab1c534981fdbad0d7d5d304 Mon Sep 17 00:00:00 2001 From: Jonas Holmberg Date: Thu, 26 Sep 2013 09:41:10 +0200 Subject: [PATCH] client: Send setup reply once only If find_media() failed in handle_setup_request() two replies was sent. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708819 --- gst/rtsp-server/rtsp-client.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 1d192a7..f351f24 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -564,11 +564,13 @@ no_factory_access: { GST_ERROR ("client %p: not authorized to see factory path %s", client, path); + /* error reply is already sent */ return NULL; } not_authorized: { GST_ERROR ("client %p: not authorized for factory path %s", client, path); + /* error reply is already sent */ return NULL; } no_media: @@ -1420,10 +1422,12 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx) } else { if ((media = gst_rtsp_session_media_get_media (sessmedia))) g_object_ref (media); + else + goto media_not_found; } /* no media, not found then */ if (media == NULL) - goto media_not_found; + goto media_not_found_no_reply; if (path[matched] == '\0') goto control_not_found; @@ -1548,6 +1552,12 @@ no_pool: send_generic_response (client, GST_RTSP_STS_SESSION_NOT_FOUND, ctx); return FALSE; } +media_not_found_no_reply: + { + GST_ERROR ("client %p: media '%s' not found", client, path); + /* error reply is already sent */ + return FALSE; + } media_not_found: { GST_ERROR ("client %p: media '%s' not found", client, path); @@ -1980,6 +1990,7 @@ session_not_found: not_authorized: { GST_ERROR ("client %p: not allowed", client); + /* error reply is already sent */ goto done; } not_implemented: -- 2.7.4