Software /
code /
prosody
Comparison
core/s2smanager.lua @ 2165:529af807ba1a
s2smanager: Log warning when trying to send a stanza from a host we don't serve, instead of a traceback (thanks stpeter)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 25 Nov 2009 03:30:00 +0000 |
parent | 2090:7810648ea26d |
child | 2166:fb01f0906564 |
child | 2711:5d97fb043141 |
comparison
equal
deleted
inserted
replaced
2159:2ef4458b23d9 | 2165:529af807ba1a |
---|---|
77 session.sendq = nil; | 77 session.sendq = nil; |
78 end | 78 end |
79 end | 79 end |
80 | 80 |
81 function send_to_host(from_host, to_host, data) | 81 function send_to_host(from_host, to_host, data) |
82 if not hosts[from_host] then | |
83 log("warn", "Attempt to send stanza from %s - a host we don't serve", from_host); | |
84 return false; | |
85 end | |
82 local host = hosts[from_host].s2sout[to_host]; | 86 local host = hosts[from_host].s2sout[to_host]; |
83 if host then | 87 if host then |
84 -- We have a connection to this host already | 88 -- We have a connection to this host already |
85 if host.type == "s2sout_unauthed" and (data.name ~= "db:verify" or not host.dialback_key) and ((not data.xmlns) or data.xmlns == "jabber:client" or data.xmlns == "jabber:server") then | 89 if host.type == "s2sout_unauthed" and (data.name ~= "db:verify" or not host.dialback_key) and ((not data.xmlns) or data.xmlns == "jabber:client" or data.xmlns == "jabber:server") then |
86 (host.log or log)("debug", "trying to send over unauthed s2sout to "..to_host); | 90 (host.log or log)("debug", "trying to send over unauthed s2sout to "..to_host); |