GNOME Bugzilla – Bug 774806
user-agent duplicated in rtspsrc header
Last modified: 2018-11-03 15:14:37 UTC
Created attachment 340464 [details] [review] Quick work around fix The commit from: https://bugzilla.gnome.org/show_bug.cgi?id=750101 causes rtspsrc to add two 'user-agents' to the rtsp header. This causes problems with some rtsp servers (tested with Panasonic cameras) as they reply back 400 (Bad Request) and hence the stream does not connect (viewable in logs as well as wireshark). I've tested with v1.6, however, believe the issue to remain in master (I'll try and get round to testing with master when I can!). It appears that gst_rtsp_ext_list_before_send() does not check whether any initialisation has been done already and hence just adds what it gets from the iface. So far I've just added some code to check if there's multiple GST_RTSP_HDR_USER_AGENT's in the message header in gst_rtspsrc_try_send() and remove the header value if needed. A better solution would be to add functionality to either have gst_rtsp_ext_list_before_send() check whether something has been already initialised, or check against rtsp_headers[] to see if there are multiples of headers when there shouldn't be and remove the latest. Any pointers would be helpful on where best to implement this! Cheers, Stu
Who would've added the user agent before that function already? Which code?
Hi Sebastian, It's a case that gst_rtsp_ext_list_before_send() does not take into account anything initialised already. With a couple of prints and gst_rtsp_message_dump() around the gst_rtsp_ext_list_before_send() in gst_rtspsrc_try_send(), we get the following: Message dump BEFORE gst_rtsp_ext_list_before_send(): RTSP request message 0x7fedb4898c80 request line: method: 'OPTIONS' uri: 'rtsp://192.168.0.54:554/MediaInput/h264' version: '1.0' headers: key: 'User-Agent', value: 'GStreamer/1.6.3' body: Message dump AFTER gst_rtsp_ext_list_before_send(): RTSP request message 0x7fedb4898c80 request line: method: 'OPTIONS' uri: 'rtsp://192.168.0.54:554/MediaInput/h264' version: '1.0' headers: key: 'User-Agent', value: 'GStreamer/1.6.3' key: 'User-Agent', value: 'RealMedia Player Version 6.0.9.1235 (linux-2.0-libc6-i386-gcc2.95)' key: 'ClientChallenge', value: '9e26d33f2984236010ef6253fb1887f7' key: 'CompanyID', value: 'KnKV4M4I/B2FjJ1TToLycw==' key: 'GUID', value: '00000000-0000-0000-0000-000000000000' key: 'RegionData', value: '0' key: 'PlayerStarttime', value: '[28/03/2003:22:50:23 00:00]' key: 'ClientID', value: 'Linux_2.4_6.0.9.1235_play32_RN01_EN_586' body: I've narrowed it down to the call to iface->before_send (ext, req) in gst_rtsp_extension_before_send(), but unsure where to go from there.
*** Bug 772043 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/327.