From 90fae58b49cbc0bf0be76fe889952a81f4c3aed1 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 4 Feb 2020 13:19:40 +0100 Subject: ACL LOG: make max log entries configurable. --- src/acl.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/acl.c') diff --git a/src/acl.c b/src/acl.c index 97c00d4f8..fa57e210c 100644 --- a/src/acl.c +++ b/src/acl.c @@ -1576,6 +1576,12 @@ void addACLLogEntry(client *c, int reason, int keypos, sds username) { /* Add it to our list of entires. We'll have to trim the list * to its maximum size. */ listAddNodeHead(ACLLog, le); + while(listLength(ACLLog) > server.acllog_max_len) { + listNode *ln = listLast(ACLLog); + ACLLogEntry *le = listNodeValue(ln); + ACLFreeLogEntry(le); + listDelNode(ACLLog,ln); + } } } -- cgit v1.2.1