From 0ea1b559bf1706d35683db648ae511e97bf35a47 Mon Sep 17 00:00:00 2001 From: Ognyan Tonchev Date: Tue, 9 Sep 2014 11:37:26 +0200 Subject: [PATCH] rtspconnection: ignore timeout in session request header The timeout parameter is only allowed in a session response header but some clients, like Honeywell VMS applications, send it as part of the session request header. Ignore everything from the semicolon to the end of the line when parsing session id. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736267 --- gst-libs/gst/rtsp/gstrtspconnection.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index da969f029f..559b989b66 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1782,6 +1782,19 @@ parse_line (guint8 * buffer, GstRTSPMessage * msg) next_value++; } + if (field == GST_RTSP_HDR_SESSION) { + /* The timeout parameter is only allowed in a session response header + * but some clients send it as part of the session request header. + * Ignore everything from the semicolon to the end of the line. */ + next_value = value; + while (*next_value != '\0') { + if (*next_value == ';') { + break; + } + next_value++; + } + } + /* trim space */ if (value != next_value && next_value[-1] == ' ') next_value[-1] = '\0';