Comparison

plugins/mod_dialback.lua @ 347:fba39fda0879

Don't error if the original s2s connection has closed before we get the dialback result
author Matthew Wild <mwild1@gmail.com>
date Wed, 19 Nov 2008 21:07:40 +0000
parent 260:182f0c895676
child 348:aab28eacd84e
comparison
equal deleted inserted replaced
346:22c8f7d412a1 347:fba39fda0879
53 else 53 else
54 -- Warn the original connection that is was not verified successfully 54 -- Warn the original connection that is was not verified successfully
55 log("warn", "dialback for "..(origin.dialback_verifying.from_host or "(unknown)").." failed"); 55 log("warn", "dialback for "..(origin.dialback_verifying.from_host or "(unknown)").." failed");
56 valid = "invalid"; 56 valid = "invalid";
57 end 57 end
58 origin.dialback_verifying.sends2s(format("<db:result from='%s' to='%s' id='%s' type='%s'>%s</db:result>", 58 if not origin.dialback_verifying.sends2s then
59 attr.from, attr.to, attr.id, valid, origin.dialback_verifying.dialback_key)); 59 log("warn", "Incoming s2s session was closed in the meantime, so we can't notify it of the db result");
60 else
61 origin.dialback_verifying.sends2s(format("<db:result from='%s' to='%s' id='%s' type='%s'>%s</db:result>",
62 attr.from, attr.to, attr.id, valid, origin.dialback_verifying.dialback_key));
63 end
60 end 64 end
61 end); 65 end);
62 66
63 add_handler({ "s2sout_unauthed", "s2sout" }, "result", xmlns_dialback, 67 add_handler({ "s2sout_unauthed", "s2sout" }, "result", xmlns_dialback,
64 function (origin, stanza) 68 function (origin, stanza)