rtsp-stream : fix race condition in send_tcp_message
authorAdam x Nilsson <adamni@axis.com>
Mon, 7 Oct 2019 10:13:47 +0000 (12:13 +0200)
committerMathieu Duponchelle <mduponchelle1@gmail.com>
Mon, 14 Oct 2019 19:40:00 +0000 (19:40 +0000)
commit0b1b6670c8b73ad0311f90a6387bdd372cea5896
tree6d49136b3b36d480e08c7f3669f0b0f56b9aaac2
parent6b3bd23e40e0194fabebde18885377081139b9fc
rtsp-stream : fix race condition in send_tcp_message

If one thread is inside the send_tcp_message function and are done
sending rtp or rtcp messages so the n_outstanding variable is zero
however have not exit the loop sending the messages. While sending its
messages, transports have been added or removed to the transport list,
so the cache should be updated. If now an additional thread comes to
the function send_tcp_message and trying to send rtp messages it will
first destroy the rtp cache that is still being iterated trough by the
first thread.

Fixes #81
gst/rtsp-server/rtsp-stream.c