Changeset

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
parents 2159:2ef4458b23d9
children 2166:fb01f0906564 2168:1a99a3bf3ce6
files core/s2smanager.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Mon Nov 23 20:18:04 2009 +0000
+++ b/core/s2smanager.lua	Wed Nov 25 03:30:00 2009 +0000
@@ -79,6 +79,10 @@
 end
 
 function send_to_host(from_host, to_host, data)
+	if not hosts[from_host] then
+		log("warn", "Attempt to send stanza from %s - a host we don't serve", from_host);
+		return false;
+	end
 	local host = hosts[from_host].s2sout[to_host];
 	if host then
 		-- We have a connection to this host already