added timeout to oppened tunnel to avoid possible DOS

This commit is contained in:
Adolfo Gómez García 2022-03-29 13:08:34 +02:00
parent d9be83863c
commit 2f5f87e122

View File

@ -230,6 +230,7 @@ def tunnel_main():
try:
client, addr = sock.accept()
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(
message.Message(message.Command.TUNNEL, (client, addr))