s2smanager: Only bounce real stanzas on s2s failure, not dialback and friends (thanks elghinn)

Tue, 03 Aug 2010 09:39:05 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 03 Aug 2010 09:39:05 +0100
changeset 3431
c499f4752cd8
parent 3430
970690b3cb28
child 3432
7f3e45955725

s2smanager: Only bounce real stanzas on s2s failure, not dialback and friends (thanks elghinn)

core/s2smanager.lua file | annotate | diff | comparison | revisions
--- a/core/s2smanager.lua	Mon Aug 02 20:11:08 2010 +0500
+++ b/core/s2smanager.lua	Tue Aug 03 09:39:05 2010 +0100
@@ -57,6 +57,7 @@
 	return a.priority < b.priority or (a.priority == b.priority and a.weight > b.weight);
 end
 
+local bouncy_stanzas = { message = true, presence = true, iq = true };
 local function bounce_sendq(session, reason)
 	local sendq = session.sendq;
 	if sendq then
@@ -71,7 +72,7 @@
 		for i, data in ipairs(sendq) do
 			local reply = data[2];
 			local xmlns = reply.attr.xmlns;
-			if not xmlns then
+			if not xmlns and bouncy_stanzas[reply.name] then
 				reply.attr.type = "error";
 				reply:tag("error", {type = "cancel"})
 					:tag("remote-server-not-found", {xmlns = "urn:ietf:params:xml:ns:xmpp-stanzas"}):up();

mercurial