changeset 2808:2cc02ee82e8c

mod_firewall/test: Move session variable to avoid warning about it being shadowed [luacheck]
author Kim Alvefur <zash@zash.se>
date Fri, 20 Oct 2017 02:53:12 +0200
parents 2c3334131a7d
children 6d3935226ffb
files mod_firewall/test.lib.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/test.lib.lua	Fri Oct 20 02:52:58 2017 +0200
+++ b/mod_firewall/test.lib.lua	Fri Oct 20 02:53:12 2017 +0200
@@ -27,7 +27,6 @@
 	local stats_dropped, stats_passed = 0, 0;
 
 	load_unload_scripts(set.new(arg));
-	local session = { notopen = true };
 	local stream_callbacks = { default_ns = "jabber:client" };
 
 	function stream_callbacks.streamopened(session)
@@ -35,7 +34,7 @@
 	end
 	function stream_callbacks.streamclosed()
 	end
-	function stream_callbacks.error(session, error_name, error_message)
+	function stream_callbacks.error(session, error_name, error_message) -- luacheck: ignore 212/session
 		stderr("Fatal error parsing XML stream: "..error_name..": "..tostring(error_message))
 		assert(false);
 	end
@@ -49,6 +48,7 @@
 		end
 	end
 
+	local session = { notopen = true };
 	local stream = xmppstream.new(session, stream_callbacks);
 	stream:feed("<stream:stream xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>");
 	local line_count = 0;