aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_dialback.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-06-06 22:51:33 +0100
committerMatthew Wild <mwild1@gmail.com>2011-06-06 22:51:33 +0100
commitb761dbf8c31b0d272fe0005f7f40d281534a82e1 (patch)
treeee59e21179ad34dd00e72e38cb65bc51d8831b9f /plugins/mod_dialback.lua
parent16a24fc55fa5027a2d4ae20ce8f086cb9c20849a (diff)
downloadprosody-b761dbf8c31b0d272fe0005f7f40d281534a82e1.tar.gz
prosody-b761dbf8c31b0d272fe0005f7f40d281534a82e1.zip
mod_dialback: More robust handling of multiple outstanding dialback requests for the same domain, fixes intermittent s2s with some (patched?) ejabberds
Diffstat (limited to 'plugins/mod_dialback.lua')
-rw-r--r--plugins/mod_dialback.lua8
1 files 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