mod_legacyauth: Fix for sending error response to unauthed s2s connections
authorMatthew Wild <mwild1@gmail.com>
Thu, 13 Sep 2012 18:48:35 +0100
changeset 5126 a0673b644f05
parent 5124 a4a74a0e9b9c
child 5127 cbcd173ad906
child 5128 834ab74585ec
mod_legacyauth: Fix for sending error response to unauthed s2s connections
plugins/mod_legacyauth.lua
--- a/plugins/mod_legacyauth.lua	Thu Sep 13 18:31:34 2012 +0100
+++ b/plugins/mod_legacyauth.lua	Thu Sep 13 18:48:35 2012 +0100
@@ -35,7 +35,7 @@
 	local session, stanza = event.origin, event.stanza;
 
 	if session.type ~= "c2s_unauthed" then
-		session.send(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections."));
+		(session.sends2s or session.send)(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections."));
 		return true;
 	end