From ffaf2781f53a9bdbf3c3b8e6b03985c692385898 Mon Sep 17 00:00:00 2001 From: maride Date: Thu, 28 Sep 2017 12:13:03 +0200 Subject: [PATCH] Update Whitelist after the connection is closed --- knockr.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/knockr.go b/knockr.go index 32ca437..496299b 100644 --- a/knockr.go +++ b/knockr.go @@ -68,6 +68,13 @@ func gateway_handler(c net.Conn) { fmt.Println("[OK ] Whitelisted host ", host, " connected") update_whitelist_time(host) proxy(c) + update_whitelist_time(host) + // yes, we're updating this before and after. + // why? Consider long TCP connections, e.g. in games + // Then the specified Timeout may be reached before the connection is even closed + // This won't affect this connection (it'll stay open even if the timeout is reached) + // but another connection won't be possible, even if it's right after the closing of + // the first connection. ¯\_(ツ)_/¯ } else { fmt.Println("[BLK] Blocking host ", host) }