added timeout to oppened tunnel to avoid possible DOS

This commit is contained in:
Adolfo Gómez García 2022-03-29 13:08:54 +02:00
commit 70b3544f2a

View File

@ -222,8 +222,8 @@ def tunnel_main():
while not do_stop:
try:
client, addr = sock.accept()
client.settimeout(3.0)
logger.debug('ACCEPTED CONNECTION from %s (%s)', addr, client)
client.settimeout(3.0)
# Select BEST process for sending this new connection
prcs.best_child().send((client, addr))
del client # Ensure socket is controlled on child process