From a1e5bde58d1f6c3b4452a063d251db8f3d5dbe77 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 3 Jul 2013 16:15:04 +0200 Subject: [PATCH] client: error out on non-aggregate control We require aggregate control (for now) for PLAY, PAUSE and TEARDOWN. --- gst/rtsp-server/rtsp-client.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 8dbd8a5f0e..db821746de 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -727,6 +727,10 @@ handle_teardown_request (GstRTSPClient * client, GstRTSPClientState * state) if (!sessmedia) goto not_found; + /* only aggregate control for now.. */ + if (path[matched] != '\0') + goto no_aggregate; + state->sessmedia = sessmedia; /* we emit the signal before closing the connection */ @@ -775,6 +779,13 @@ not_found: send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state); return FALSE; } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state); + return FALSE; + } } static GstRTSPResult @@ -894,6 +905,9 @@ handle_pause_request (GstRTSPClient * client, GstRTSPClientState * state) if (!sessmedia) goto not_found; + if (path[matched] != '\0') + goto no_aggregate; + state->sessmedia = sessmedia; rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia); @@ -942,6 +956,13 @@ not_found: send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state); return FALSE; } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state); + return FALSE; + } invalid_state: { GST_ERROR ("client %p: not PLAYING or RECORDING", client); @@ -981,6 +1002,9 @@ handle_play_request (GstRTSPClient * client, GstRTSPClientState * state) if (!sessmedia) goto not_found; + if (path[matched] != '\0') + goto no_aggregate; + state->sessmedia = sessmedia; state->media = media = gst_rtsp_session_media_get_media (sessmedia); @@ -1089,6 +1113,13 @@ not_found: send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state); return FALSE; } +no_aggregate: + { + GST_ERROR ("client %p: no aggregate path %s", client, path); + send_generic_response (client, + GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state); + return FALSE; + } invalid_state: { GST_ERROR ("client %p: not PLAYING or READY", client);