gstreamer/gst/rtsp-server
Branko Subasic 6fc8b963a5 rtsp-stream: avoid deadlock in send_func
Currently the send_func() runs in a thread of its own which is started
the first time we enter handle_new_sample(). It runs in an outer loop
until priv->continue_sending is FALSE, which happens when a TEARDOWN
request is received. We use a local variable, cont, which is initialized
to TRUE, meaning that we will always enter the outer loop, and at the
end of the outer loop we assign it the value of priv->continue_sending.

Within the outer loop there is an inner loop, where we wait to be
signaled when there is more data to send. The inner loop is exited when
priv->send_cookie has changed value, which it does when more data is
available or when a TEARDOWN has been received.

But if we get a TEARDOWN before send_func() is entered we will get stuck
in the inner loop because no one will increase priv->session_cookie
anymore.

By not entering the outer loop in send_func() if priv->continue_sending
is FALSE we make sure that we do not get stuck in send_func()'s inner
loop should we receive a TEARDOWN before the send thread has started.

Change-Id: I7338a0ea60ea435bb685f875965f5165839afa20
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/187>
2021-02-01 20:27:39 +01:00
..
meson.build Meson: Use pkg-config generator 2020-10-23 14:03:43 +00:00
rtsp-address-pool.c libs: fix API export/import and 'inconsistent linkage' on MSVC 2018-09-24 09:36:21 +01:00
rtsp-address-pool.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-auth.c rtsp-auth: Fix NULL pointer dereference when handling an invalid basic Authorization header 2020-03-23 16:06:43 +02:00
rtsp-auth.h rtsp-auth: Add support for parsing .htdigest files 2018-06-21 15:47:39 +02:00
rtsp-client.c rtsp-client: cleanup transports during TEARDOWN 2021-01-22 16:42:00 +01:00
rtsp-client.h onvif: Implement and test the Streaming Specification 2019-06-06 18:45:17 +02:00
rtsp-context.c doc: Fix some docstrings 2019-05-13 17:00:00 -04:00
rtsp-context.h Include ONVIF types from single-include rtsp-server.h 2018-11-01 10:18:22 +02:00
rtsp-latency-bin.c rtsp-latency-bin: replace G_TYPE_INSTANCE_GET_PRIVATE as it's been deprecated 2020-01-23 17:00:59 +02:00
rtsp-latency-bin.h onvif: encapsulate onvif part into a bin 2018-10-03 13:26:36 +03:00
rtsp-media-factory-uri.c rtsp-media: Try to get dynamic payloaders by name from their bin first 2019-07-22 19:44:28 +03:00
rtsp-media-factory-uri.h Fix typos 2019-06-07 13:42:24 +02:00
rtsp-media-factory.c rtsp-media-factory: expose API to disable RTCP 2020-10-10 02:06:18 +02:00
rtsp-media-factory.h rtsp-media-factory: expose API to disable RTCP 2020-10-10 02:06:18 +02:00
rtsp-media.c rtsp-media: Only count senders when counting blocked streams 2020-12-17 15:28:29 +01:00
rtsp-media.h media-factory: complete DSCP QoS setting support 2020-05-18 11:12:00 +03:00
rtsp-mount-points.c Make a mount point of "/" work correctly. 2020-12-23 19:45:13 +00:00
rtsp-mount-points.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-onvif-client.c onvif: Implement and test the Streaming Specification 2019-06-06 18:45:17 +02:00
rtsp-onvif-client.h onvif: Implement and test the Streaming Specification 2019-06-06 18:45:17 +02:00
rtsp-onvif-media-factory.c onvif-media: fix "void function returning a value" compiler warning 2019-06-25 13:19:44 +01:00
rtsp-onvif-media-factory.h onvif-media-factory: define autoptr cleanup function 2020-06-10 11:51:31 +00:00
rtsp-onvif-media.c onvif-media: fix "void function returning a value" compiler warning 2019-06-25 13:19:44 +01:00
rtsp-onvif-media.h Mark all ONVIF-specific subclasses as Since 1.14 2018-11-01 10:23:02 +02:00
rtsp-onvif-server.c Include ONVIF types from single-include rtsp-server.h 2018-11-01 10:18:22 +02:00
rtsp-onvif-server.h onvif: Implement and test the Streaming Specification 2019-06-06 18:45:17 +02:00
rtsp-params.c libs: fix API export/import and 'inconsistent linkage' on MSVC 2018-09-24 09:36:21 +01:00
rtsp-params.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-permissions.c libs: fix API export/import and 'inconsistent linkage' on MSVC 2018-09-24 09:36:21 +01:00
rtsp-permissions.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-sdp.c rtsp-sdp: Fix resource leak in mikey messsage 2020-07-15 11:19:40 +02:00
rtsp-sdp.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-server-internal.h rtsp-media-factory: expose API to disable RTCP 2020-10-10 02:06:18 +02:00
rtsp-server-object.h rtsp-client: Handle Content-Length limitation 2019-04-22 09:17:13 +00:00
rtsp-server-prelude.h Include ONVIF types from single-include rtsp-server.h 2018-11-01 10:18:22 +02:00
rtsp-server.c Don't pass default GLib marshallers for signals 2019-11-04 14:16:10 +00:00
rtsp-server.h rtsp-server: Declare GstRTSPServer struct before anything else 2018-11-01 11:29:01 +02:00
rtsp-session-media.c Make a mount point of "/" work correctly. 2020-12-23 19:45:13 +00:00
rtsp-session-media.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-session-pool.c Don't pass default GLib marshallers for signals 2019-11-04 14:16:10 +00:00
rtsp-session-pool.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-session.c rtsp-session: Butcher the file to please gst-indent in the CI 2019-12-18 19:48:31 +00:00
rtsp-session.h rtsp-session & client: Remove deprecated GTimeVal 2019-12-18 19:48:31 +00:00
rtsp-stream-transport.c rtsp-stream-transport: Fix accidental API/ABI breakage with message_sent callbacks 2020-05-01 10:45:45 +03:00
rtsp-stream-transport.h rtsp-stream-transport: Fix accidental API/ABI breakage with message_sent callbacks 2020-05-01 10:45:45 +03:00
rtsp-stream.c rtsp-stream: avoid deadlock in send_func 2021-02-01 20:27:39 +01:00
rtsp-stream.h onvif: Implement and test the Streaming Specification 2019-06-06 18:45:17 +02:00
rtsp-thread-pool.c rtsp-thread-pool.c: fix clang 10 warning 2020-08-03 22:29:49 +03:00
rtsp-thread-pool.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00
rtsp-token.c libs: fix API export/import and 'inconsistent linkage' on MSVC 2018-09-24 09:36:21 +01:00
rtsp-token.h rtsp-server: GST_EXPORT -> GST_RTSP_SERVER_API 2018-03-13 13:37:13 +00:00