GNOME Bugzilla – Bug 475731
rtspconnection is able to read incomplete messages
Last modified: 2007-09-11 19:08:27 UTC
Message reading mechanism in gstrtspconnection.c::gst_rtsp_connection_receive() contains multiple gst_rtsp_connection_read() calls which can be interrupted with gst_rtsp_connection_flush() method. This can lead to situation where some data has already been read from connection and then the receive operation is canceled (e.g. when pipeline is paused). Now we have incomplete, partially received RTSP message waiting, and this causes the next gst_rtsp_connection_receive() call to fail with "Parse error".
Created attachment 95324 [details] [review] Prevent partial message reading from rtsp connection Here is one possible solution to this problem. It allows only the first gst_rtsp_connection_read() (renamed to gst_rtsp_connection_read_internal()) call to be interrupted. In other words, if message reading has already been started, it needs to be finished too in order to avoid broken messages.
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com> * gst-libs/gst/rtsp/gstrtspconnection.c: (gst_rtsp_connection_read_internal), (gst_rtsp_connection_read), (read_body), (gst_rtsp_connection_receive): Make sure we can not cancel in the middle of receiving a message. Fixes #475731.