added timeout to oppened tunnel to avoid possible DOS

This commit is contained in:
Adolfo Gómez García 2022-03-29 13:08:49 +02:00
parent a9c32debd2
commit 1ff0a623db

View File

@ -222,6 +222,7 @@ 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)
# Select BEST process for sending this new connection
prcs.best_child().send((client, addr))