mod_firewall/test: Move session variable to avoid warning about it being shadowed [luacheck] default tip

Fri, 20 Oct 2017 02:53:12 +0200

author
Kim Alvefur <zash@zash.se>
date
Fri, 20 Oct 2017 02:53:12 +0200
changeset 2808
2cc02ee82e8c
parent 2807
2c3334131a7d

mod_firewall/test: Move session variable to avoid warning about it being shadowed [luacheck]

mod_firewall/test.lib.lua file | annotate | diff | comparison | revisions
--- 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;

mercurial