Software / code / prosody
Comparison
plugins/mod_dialback.lua @ 5778:8ea6fa8459e3
mod_dialback: Change level of some log statements to be more appropriate
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 10 Aug 2013 19:53:22 +0200 |
| parent | 5776:bd0ff8ae98a8 |
| child | 6299:a1da78658a82 |
comparison
equal
deleted
inserted
replaced
| 5777:c98f11bcd0ea | 5778:8ea6fa8459e3 |
|---|---|
| 24 | 24 |
| 25 function initiate_dialback(session) | 25 function initiate_dialback(session) |
| 26 -- generate dialback key | 26 -- generate dialback key |
| 27 session.dialback_key = generate_dialback(session.streamid, session.to_host, session.from_host); | 27 session.dialback_key = generate_dialback(session.streamid, session.to_host, session.from_host); |
| 28 session.sends2s(st.stanza("db:result", { from = session.from_host, to = session.to_host }):text(session.dialback_key)); | 28 session.sends2s(st.stanza("db:result", { from = session.from_host, to = session.to_host }):text(session.dialback_key)); |
| 29 session.log("info", "sent dialback key on outgoing s2s stream"); | 29 session.log("debug", "sent dialback key on outgoing s2s stream"); |
| 30 end | 30 end |
| 31 | 31 |
| 32 function verify_dialback(id, to, from, key) | 32 function verify_dialback(id, to, from, key) |
| 33 return key == generate_dialback(id, to, from); | 33 return key == generate_dialback(id, to, from); |
| 34 end | 34 end |
| 69 local attr = stanza.attr; | 69 local attr = stanza.attr; |
| 70 local to, from = nameprep(attr.to), nameprep(attr.from); | 70 local to, from = nameprep(attr.to), nameprep(attr.from); |
| 71 | 71 |
| 72 if not hosts[to] then | 72 if not hosts[to] then |
| 73 -- Not a host that we serve | 73 -- Not a host that we serve |
| 74 origin.log("info", "%s tried to connect to %s, which we don't serve", from, to); | 74 origin.log("warn", "%s tried to connect to %s, which we don't serve", from, to); |
| 75 origin:close("host-unknown"); | 75 origin:close("host-unknown"); |
| 76 return true; | 76 return true; |
| 77 elseif not from then | 77 elseif not from then |
| 78 origin:close("improper-addressing"); | 78 origin:close("improper-addressing"); |
| 79 end | 79 end |