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
This commit is contained in:
Michael Olbrich 2014-06-12 12:36:26 +02:00 committed by Tim-Philipp Müller
parent 79cf59b7dd
commit 5ebfe5b26b

View file

@ -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. */
}