GNOME Bugzilla – Bug 688395
rtsp-server: socket not closed when removing GSource
Last modified: 2014-02-25 22:28:59 UTC
Created attachment 229044 [details] [review] Close socket when removing GSource I've attached a suggested patch for the following problem: When stopping a GstRTSPServer by calling g_source_remove, passing the source ID that was returned from gst_rtsp_server_attach, the server doesn't stop listening on the RTSP port. This means that the server can't be started again using attach.
Created attachment 229045 [details] Test program for starting and stopping multiple times I used this modified version of gst-rtsp-server/tests/test-cleanup.c for reproducing the problem and checking the fix. It starts and stops the server 3 times. While running the program, I checked with netstat -a | grep 8554 at what times the server was listening on the port (watch -n 0.1 'netstat -a | grep 8554').
commit a0c2dca4ddb930cc70532b4e7943a641cb687b82 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Tue Nov 20 11:30:09 2012 +0100 test: add test for server reuse See https://bugzilla.gnome.org/show_bug.cgi?id=688395 commit 0eeb4a5c733a42378a9909ded740ae9aeec84a80 Author: David Svensson Fors <davidsf@axis.com> Date: Thu Nov 15 14:02:37 2012 +0100 server: start and stop multiple times Stop listening on the RTSP port when the GSource is removed, so clients can't connect and the server can be started again. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688395