Async vs sync close response in rtsp teardown handler.
I have an issue with hanging RTSP connections which do not close properly. It happens rarely, if ever. And so far failed validation with the Onvif device test tool (OTT, latest version). OTT seems to send a RTSP teardown. VLC etc seems to send RTCP goodbyes (beside the point)? I'm having an issue with an older version of the library, but looking at the code from the newer ones, it does the same thing.
So my question follows this code path:
-
RTSP client sends teardown.
-
rtsp-client.c: handle_teardown_request -> send_message -> do_send_messages -> gst_rtsp_watch_send_messages (..., &id). Now if close response is sent sync, id is returned == 0. Comments, code. Everything states id == 0. Async close != 0.
-
rtspconnection.c calls callback for sent messages in the worker.
-
in rtsp-client.c callback for watch async messages.
if (priv->close_seq && priv->close_seq == cseq) {
GST_INFO ("client %p: send close message", client);
close = TRUE;
priv->close_seq = 0;
}
This only cares for != 0 close_seq. Any non sync close response (cseq 0) is left hanging.
Ie. The code never cares for sync closes.
(Also the debug msg is probably wrong. Sent, not send.)
I fail to understand how this is meant to work. Who and what handle sync close response messages? Am I missing something?