1
0
mirror of https://github.com/moparisthebest/sslh synced 2024-11-14 05:05:02 -05:00

sslh-fork: close all listening sockets in shoveler

When we're watching multiple sockets, we don't want to just close
the active one we got a connection on before launching the shoveler.
If we want to restart the daemon, we run into problems because the
socket is still in use.  Instead, close all the sockets we were
listening on.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2013-09-17 00:35:45 -04:00
parent 5998c9ec1a
commit 71ce82815c

View File

@ -157,7 +157,8 @@ void main_loop(int listen_sockets[], int num_addr_listen)
if (!fork()) if (!fork())
{ {
close(listen_sockets[i]); for (i = 0; i < num_addr_listen; ++i)
close(listen_sockets[i]);
start_shoveler(in_socket); start_shoveler(in_socket);
exit(0); exit(0);
} }