mod_limit_auth: Only apply limit to normal c2s sessions (thanks cuc)
authorKim Alvefur <zash@zash.se>
Fri, 30 Oct 2015 17:47:48 +0100
changeset 1945 2a5a44d5b935
parent 1944 453eee191e18
child 1946 ff95d983940c
mod_limit_auth: Only apply limit to normal c2s sessions (thanks cuc)
mod_limit_auth/mod_limit_auth.lua
--- a/mod_limit_auth/mod_limit_auth.lua	Wed Oct 28 16:16:59 2015 +0100
+++ b/mod_limit_auth/mod_limit_auth.lua	Fri Oct 30 17:47:48 2015 +0100
@@ -34,6 +34,7 @@
 
 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:auth", function (event)
 	local origin = event.origin;
+	if origin.type ~= "c2s_unauthed" then return end
 	if not get_throttle(origin.ip):peek(1) then
 		origin.log("warn", "Too many authentication attepmts for ip %s", origin.ip);
 		tarpit_delay();