After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688395 - rtsp-server: socket not closed when removing GSource
rtsp-server: socket not closed when removing GSource
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-15 13:22 UTC by David Svensson Fors
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Close socket when removing GSource (827 bytes, patch)
2012-11-15 13:22 UTC, David Svensson Fors
none Details | Review
Test program for starting and stopping multiple times (2.14 KB, text/x-csrc)
2012-11-15 13:29 UTC, David Svensson Fors
  Details

Description David Svensson Fors 2012-11-15 13:22:27 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.
Comment 1 David Svensson Fors 2012-11-15 13:29:33 UTC
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').
Comment 2 Wim Taymans 2012-11-20 10:31:22 UTC
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