aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_dialback.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-19 21:07:40 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-19 21:07:40 +0000
commit761c52771a80c3dd331ce4bc2da8c6490f118932 (patch)
tree20ad7d0979843de3025af47c988b7ab3ea48b228 /plugins/mod_dialback.lua
parent43c5342160551d24cb634ae9936398100f1072da (diff)
downloadprosody-761c52771a80c3dd331ce4bc2da8c6490f118932.tar.gz
prosody-761c52771a80c3dd331ce4bc2da8c6490f118932.zip
Don't error if the original s2s connection has closed before we get the dialback result
Diffstat (limited to 'plugins/mod_dialback.lua')
-rw-r--r--plugins/mod_dialback.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/mod_dialback.lua b/plugins/mod_dialback.lua
index c17cbcaf..d7697535 100644
--- a/plugins/mod_dialback.lua
+++ b/plugins/mod_dialback.lua
@@ -55,8 +55,12 @@ add_handler({ "s2sout_unauthed", "s2sout" }, "verify", xmlns_dialback,
log("warn", "dialback for "..(origin.dialback_verifying.from_host or "(unknown)").." failed");
valid = "invalid";
end
- origin.dialback_verifying.sends2s(format("<db:result from='%s' to='%s' id='%s' type='%s'>%s</db:result>",
- attr.from, attr.to, attr.id, valid, origin.dialback_verifying.dialback_key));
+ if not origin.dialback_verifying.sends2s then
+ log("warn", "Incoming s2s session was closed in the meantime, so we can't notify it of the db result");
+ else
+ origin.dialback_verifying.sends2s(format("<db:result from='%s' to='%s' id='%s' type='%s'>%s</db:result>",
+ attr.from, attr.to, attr.id, valid, origin.dialback_verifying.dialback_key));
+ end
end
end);