From b761dbf8c31b0d272fe0005f7f40d281534a82e1 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 6 Jun 2011 22:51:33 +0100 Subject: mod_dialback: More robust handling of multiple outstanding dialback requests for the same domain, fixes intermittent s2s with some (patched?) ejabberds --- plugins/mod_dialback.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua index 8c80dce6..5060f08f 100644 --- a/plugins/mod_dialback.lua +++ b/plugins/mod_dialback.lua @@ -60,7 +60,7 @@ module:hook("stanza/jabber:server:dialback:result", function(event) return true; end - dialback_requests[attr.from] = origin; + dialback_requests[attr.from.."/"..origin.streamid] = origin; if not origin.from_host then -- Just used for friendlier logging @@ -83,8 +83,8 @@ module:hook("stanza/jabber:server:dialback:verify", function(event) if origin.type == "s2sout_unauthed" or origin.type == "s2sout" then local attr = stanza.attr; - local dialback_verifying = dialback_requests[attr.from]; - if dialback_verifying then + local dialback_verifying = dialback_requests[attr.from.."/"..(attr.id or "")]; + if dialback_verifying and attr.from == origin.to_host then local valid; if attr.type == "valid" then s2s_make_authenticated(dialback_verifying, attr.from); @@ -101,7 +101,7 @@ module:hook("stanza/jabber:server:dialback:verify", function(event) st.stanza("db:result", { from = attr.to, to = attr.from, id = attr.id, type = valid }) :text(dialback_verifying.hosts[attr.from].dialback_key)); end - dialback_requests[attr.from] = nil; + dialback_requests[attr.from.."/"..(attr.id or "")] = nil; end return true; end -- cgit v1.2.3