From 946e1e43637e78c263c82d449ec19dfd84ed8269 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 9 Feb 2006 14:20:14 +0000 Subject: gst/rtsp/: Resurected rtpdec to make rtspsrc happy again. Original commit message from CVS: * gst/rtsp/Makefile.am: * gst/rtsp/gstrtpdec.c: (gst_rtpdec_get_type), (gst_rtpdec_class_init), (gst_rtpdec_init), (gst_rtpdec_getcaps), (gst_rtpdec_chain_rtp), (gst_rtpdec_chain_rtcp), (gst_rtpdec_set_property), (gst_rtpdec_get_property), (gst_rtpdec_change_state): * gst/rtsp/gstrtpdec.h: * gst/rtsp/gstrtsp.c: (plugin_init): * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_stream_configure_transport): * gst/rtsp/rtspconnection.c: (read_body), (rtsp_connection_receive): * gst/rtsp/rtspmessage.c: (rtsp_message_dump): Resurected rtpdec to make rtspsrc happy again. Skip attributes from the session id. Don't crash when dumping a message with an empty body. --- gst/rtsp/rtspconnection.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gst/rtsp/rtspconnection.c') diff --git a/gst/rtsp/rtspconnection.c b/gst/rtsp/rtspconnection.c index ae39df44..221369d9 100644 --- a/gst/rtsp/rtspconnection.c +++ b/gst/rtsp/rtspconnection.c @@ -376,9 +376,10 @@ read_body (gint fd, glong content_length, RTSPMessage * msg) bodyptr += r; } } + content_length += 1; done: - rtsp_message_set_body (msg, (guint8 *) body, content_length + 1); + rtsp_message_set_body (msg, (guint8 *) body, content_length); return RTSP_OK; @@ -499,7 +500,16 @@ rtsp_connection_receive (RTSPConnection * conn, RTSPMessage * msg) if (rtsp_message_get_header (msg, RTSP_HDR_SESSION, &session_id) == RTSP_OK) { - gint maxlen = sizeof (conn->session_id) - 1; + gint sesslen, maxlen, i; + + sesslen = strlen (session_id); + maxlen = sizeof (conn->session_id) - 1; + /* the sessionid can have attributes marked with ; + * Make sure we strip them */ + for (i = 0; i < sesslen; i++) { + if (session_id[i] == ';') + maxlen = i; + } /* make sure to not overflow */ strncpy (conn->session_id, session_id, maxlen); -- cgit