aboutsummaryrefslogtreecommitdiffstats
path: root/net/connlisteners.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-23 18:09:39 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-23 18:09:39 +0100
commitce86d8badcc0f93ea14f71abad9161cee80ad823 (patch)
tree4749ac1995c41fb648b608f446924e29a0bc24b7 /net/connlisteners.lua
parentdba8f998cf39a07fd93fb985a17b32a274fb23f3 (diff)
downloadprosody-ce86d8badcc0f93ea14f71abad9161cee80ad823.tar.gz
prosody-ce86d8badcc0f93ea14f71abad9161cee80ad823.zip
Initial s2s stuff
Diffstat (limited to 'net/connlisteners.lua')
-rw-r--r--net/connlisteners.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/net/connlisteners.lua b/net/connlisteners.lua
index a5c8755f..f7321cdc 100644
--- a/net/connlisteners.lua
+++ b/net/connlisteners.lua
@@ -23,14 +23,20 @@ function deregister(name)
listeners[name] = nil;
end
-function start(name, udata)
- local h = listeners[name]
+function get(name)
+ local h = listeners[name];
if not h then
pcall(dofile, "net/"..name:gsub("[^%w%-]", "_").."_listener.lua");
h = listeners[name];
- if not h then
- error("No such connection module: "..name, 0);
- end
+
+ end
+ return h;
+end
+
+function start(name, udata)
+ local h = get(name);
+ if not h then
+ error("No such connection module: "..name, 0);
end
return server_add(h,
udata.port or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0),