Comparison

plugins/mod_dialback.lua @ 5113:3393cab2dd6b

mod_dialback: Correctly check if a connection was destroyed (thanks iron)
author Kim Alvefur <zash@zash.se>
date Wed, 05 Sep 2012 16:51:16 +0200
parent 5019:017e864b459d
child 5341:760c22c822be
comparison
equal deleted inserted replaced
5112:8b94a8d92cf3 5113:3393cab2dd6b
115 else 115 else
116 -- Warn the original connection that is was not verified successfully 116 -- Warn the original connection that is was not verified successfully
117 log("warn", "authoritative server for %s denied the key", attr.from or "(unknown)"); 117 log("warn", "authoritative server for %s denied the key", attr.from or "(unknown)");
118 valid = "invalid"; 118 valid = "invalid";
119 end 119 end
120 if not dialback_verifying.sends2s then 120 if dialback_verifying.destroyed then
121 log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the db result", tostring(dialback_verifying):match("%w+$")); 121 log("warn", "Incoming s2s session %s was closed in the meantime, so we can't notify it of the db result", tostring(dialback_verifying):match("%w+$"));
122 else 122 else
123 dialback_verifying.sends2s( 123 dialback_verifying.sends2s(
124 st.stanza("db:result", { from = attr.to, to = attr.from, id = attr.id, type = valid }) 124 st.stanza("db:result", { from = attr.to, to = attr.from, id = attr.id, type = valid })
125 :text(dialback_verifying.hosts[attr.from].dialback_key)); 125 :text(dialback_verifying.hosts[attr.from].dialback_key));