Diff

plugins/s2s/s2sout.lib.lua @ 4611:8572373fa26f

mod_s2s/s2sout.lib: Log message instead of traceback when s2s isn't configured for any ports
author Matthew Wild <mwild1@gmail.com>
date Wed, 14 Mar 2012 21:43:46 +0000
parent 4602:ba898af15de5
child 4629:bdafc3e729db
line wrap: on
line diff
--- a/plugins/s2s/s2sout.lib.lua	Wed Mar 14 21:42:08 2012 +0000
+++ b/plugins/s2s/s2sout.lib.lua	Wed Mar 14 21:43:46 2012 +0000
@@ -316,7 +316,10 @@
 	if event.name ~= "s2s" then return end
 
 	local s2s_sources = portmanager.get_active_services():get("s2s");
-
+	if not s2s_sources then
+		module:log("warn", "s2s not listening on any ports, outgoing connections may fail");
+		return;
+	end
 	for source, _ in pairs(s2s_sources) do
 		if source == "*" or source == "0.0.0.0" then
 			if not socket.local_addresses then