From 5ebfe5b26b6e404e663945fbd61ad7ca3f1a058b Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 12 Jun 2014 12:36:26 +0200 Subject: [PATCH] tcpserversrc: close the server socket after accepting a connection g_socket_accept() is only called once for a server socket. So keeping the socket open ist just confusing possible clients. https://bugzilla.gnome.org/show_bug.cgi?id=731566 --- gst/tcp/gsttcpserversrc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/tcp/gsttcpserversrc.c b/gst/tcp/gsttcpserversrc.c index 4bd56af528..d2a09e9597 100644 --- a/gst/tcp/gsttcpserversrc.c +++ b/gst/tcp/gsttcpserversrc.c @@ -195,6 +195,12 @@ gst_tcp_server_src_create (GstPushSrc * psrc, GstBuffer ** outbuf) g_socket_accept (src->server_socket, src->cancellable, &err); if (!src->client_socket) goto accept_error; + GST_DEBUG_OBJECT (src, "closing server socket"); + + if (!g_socket_close (src->server_socket, &err)) { + GST_ERROR_OBJECT (src, "Failed to close socket: %s", err->message); + g_clear_error (&err); + } /* now read from the socket. */ }