GNOME Bugzilla – Bug 750991
rtsp-session: session is not finalized when connection closed by accident.
Last modified: 2015-06-23 02:16:28 UTC
Normally, at EOS, client would send TEARDOWN msg and session is finalized properly with teardown logic in handle_teardown_request But unexpected disconnection happens, this session is not finalized. During unexpected disconnection, client_watch_notify callback is called and call gst_rtsp_client_session_filter. IMHO, in this function, session is expected to be finalized but ref count 1 remains in gst_rtsp_client_session_filter. And this session is not removed from rtsp-session-pool. If user set maximum session, this also causes another problem, which is that rtsp server doesn't create session any more even though there is enough to create.
Created attachment 305282 [details] [review] rtsp-client: finalize session after unexpected disconnection happens Calls gst_rtsp_session_pool_remove in cleanup_session to finalize the session and remove from session pool
Reproduce step to see the problem. 1. Run rtsp-server with set 1(to reproduce easily) to max sessions by gst_rtsp_session_pool_set_max_sessions. 2. A client connects to this server by gst-launch playbin, and after playing, Ctrl+C to break. ( client doesn't send TEARDOWN, I have no idea this is a bug of rtspsrc ) 3. Retry to connect, server denies to accept. Because client session's number is over max session value (in this example, 1 ). This is because server doesn't clear the previous session during disconnection.
This is not a bug. server should get the signal "session-removed" and handle it. And this patch causes failure of check/gst/rtspserver:-( Thanks!