aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-12-06 23:11:21 +0000
committerMatthew Wild <mwild1@gmail.com>2008-12-06 23:11:21 +0000
commit7ee253aa3fe31b28b4692909ca0f41f330f7870f (patch)
treeecdb16ff59f116c8f8819ebb05ca10fafd11fb4d /prosody
parent6f01a1604c9ff2db942c793490aa963c8f63eafe (diff)
downloadprosody-7ee253aa3fe31b28b4692909ca0f41f330f7870f.tar.gz
prosody-7ee253aa3fe31b28b4692909ca0f41f330f7870f.zip
Some code cleaning for the main script
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody7
1 files changed, 1 insertions, 6 deletions
diff --git a/prosody b/prosody
index 76b8162d..042d0212 100755
--- a/prosody
+++ b/prosody
@@ -112,7 +112,6 @@ local path_separator = "/"; if os.getenv("WINDIR") then path_separator = "\\" en
local _mkdir = {}
function mkdir(path)
path = path:gsub("/", path_separator);
- --print("mkdir",path);
local x = io.popen("mkdir \""..path.."\" 2>&1"):read("*a");
end
function encode(s) return s and (s:gsub("%W", function (c) return string.format("%%%x", c:byte()); end)); end
@@ -138,11 +137,7 @@ eventmanager.fire_event("server-starting");
-- setup error handling
-setmetatable(_G, { __index = function (t, k) print("WARNING: ATTEMPT TO READ A NIL GLOBAL!!!", k); error("Attempt to read a non-existent global. Naughty boy.", 2); end, __newindex = function (t, k, v) print("ATTEMPT TO SET A GLOBAL!!!!", tostring(k).." = "..tostring(v)); error("Attempt to set a global. Naughty boy.", 2); end }) --]][][[]][];
-
-local protected_handler = function (conn, data, err) local success, ret = pcall(handler, conn, data, err); if not success then print("ERROR on "..tostring(conn)..": "..ret); conn:close(); end end;
-local protected_disconnect = function (conn, err) local success, ret = pcall(disconnect, conn, err); if not success then print("ERROR on "..tostring(conn).." disconnect: "..ret); conn:close(); end end;
-
+setmetatable(_G, { __index = function (t, k) error("Attempt to read a non-existent global '"..k.."'", 2); end, __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end });
local global_ssl_ctx = config.get("*", "core", "ssl");
if global_ssl_ctx then