Browse Source

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>
master
Mike Frysinger 10 years ago
parent
commit
71ce82815c
  1. 3
      sslh-fork.c

3
sslh-fork.c

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

Loading…
Cancel
Save