aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-23 18:24:55 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-23 18:24:55 +0100
commit0fb99ab508f05c662336c8e7300d8b0da22b6168 (patch)
tree0bd76e86298c91d5072dc8d90e4355c3c728e28d /net
parent790c28b5986657bb95d98574309535ff157f5162 (diff)
parentce86d8badcc0f93ea14f71abad9161cee80ad823 (diff)
downloadprosody-0fb99ab508f05c662336c8e7300d8b0da22b6168.tar.gz
prosody-0fb99ab508f05c662336c8e7300d8b0da22b6168.zip
Making the best attempt out of a bad merge from waqas
Diffstat (limited to 'net')
-rw-r--r--net/connlisteners.lua16
-rw-r--r--net/server.lua2
2 files changed, 12 insertions, 6 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),
diff --git a/net/server.lua b/net/server.lua
index 1661ba00..40cc6dc8 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -827,5 +827,5 @@ return {
stats = stats,
closeall = closeall,
addtimer = addtimer,
-
+ wraptlsclient = wraptlsclient,
}