From 31a999c10fe69916dec7e18db2b83fb04ff6a4eb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 8 Jun 2017 18:26:25 -0700 Subject: Purge inactive clients from hash in do-expiry. --- txrban.txr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/txrban.txr b/txrban.txr index f66f76e..355bacf 100644 --- a/txrban.txr +++ b/txrban.txr @@ -82,8 +82,10 @@ (defun do-expiry (now-time) (dohash (ip cli client-hash) - (if (and cli.banned (<= (to cli.banned) now-time)) - (unban cli)))) + (when (and cli.banned (<= (to cli.banned) now-time)) + (unban cli) + (when (null cli.access-hist) + (del [client-hash ip]))))) (defun unban (cli) (unless *dry-run* -- cgit v1.2.3