mod_s2s/s2sout.lib: Log message instead of traceback when s2s isn't configured for any ports
authorMatthew Wild <mwild1@gmail.com>
Wed, 14 Mar 2012 21:43:46 +0000
changeset 4611 8572373fa26f
parent 4610 171051f9dd00
child 4612 8bb93860fe46
mod_s2s/s2sout.lib: Log message instead of traceback when s2s isn't configured for any ports
plugins/s2s/s2sout.lib.lua
--- 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