Changeset

2536:22a271641c29

mod_firewall: Improve debug logging for LIST file backend
author Matthew Wild <mwild1@gmail.com>
date Mon, 20 Feb 2017 13:13:54 +0000 (2017-02-20)
parents 2535:b85d88737a32
children 2537:acdc1767a715
files mod_firewall/definitions.lib.lua
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/definitions.lib.lua	Mon Feb 20 13:13:28 2017 +0000
+++ b/mod_firewall/definitions.lib.lua	Mon Feb 20 13:13:54 2017 +0000
@@ -148,10 +148,15 @@
 				return;
 			end
 			local items = {};
+			local n = 0;
 			for line in file:lines() do
-				items[line] = true;
+				if not items[line] then
+					n = n + 1;
+					items[line] = true;
+				end
 			end
 			self.items = items;
+			module:log("debug", "Loaded %d items from %s", n, filename);
 		end;
 		add = function (self, item)
 			self.items[item] = true;