sctpenc: Fix potential shutdown deadlock
authorJohan Sternerup <johast@axis.com>
Wed, 10 May 2023 10:00:15 +0000 (12:00 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 15 May 2023 09:20:32 +0000 (09:20 +0000)
commitd7647035cc0e532483103a8458b2ee228744620e
tree2c8f1adf6cc42a8c3195193998975733f835e552
parent5add11ffbc06edb573991ac76a72d8dd8f0ea336
sctpenc: Fix potential shutdown deadlock

When transitioning from state PAUSED to READY, the sctpenc element
could previously be stuck in an endless loop trying to resend data
in case the underlying sctp stream was in the process of
resetting. usrsctp_sendv() would repeatedly return EAGAIN with the
result that 0 bytes were sent and then sctpenc would retry forever.

To bring sctpenc out of the resend loop we just need to inform the
sink pad that it is flushing, which is already done for the associated
data queue, but we also need to set the bools associated with the
sinkpads that are used as the loop criterion.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4636>
subprojects/gst-plugins-bad/ext/sctp/gstsctpenc.c