aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-05-04 23:36:50 +0100
committerMatthew Wild <mwild1@gmail.com>2010-05-04 23:36:50 +0100
commitbb00df3f5e95d57c7dff489c5a3da1b292251f85 (patch)
treef77f1673a20e30d53488924ed31f2e8d286a78f1 /prosody
parentf050b618466ad7d6008fc96d3860c0ad868af7e8 (diff)
parent3376282d8aacc5814519e16c8b04809f24b9f248 (diff)
downloadprosody-bb00df3f5e95d57c7dff489c5a3da1b292251f85.tar.gz
prosody-bb00df3f5e95d57c7dff489c5a3da1b292251f85.zip
Merge 0.7->trunk (with MUC needing checking, waqas)
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody24
1 files changed, 24 insertions, 0 deletions
diff --git a/prosody b/prosody
index 0f705b62..a70569b0 100755
--- a/prosody
+++ b/prosody
@@ -120,6 +120,29 @@ function sandbox_require()
end
end
+function set_function_metatable()
+ local mt = {};
+ function mt.__index(f, upvalue)
+ local i, name, value = 0;
+ repeat
+ i = i + 1;
+ name, value = debug.getupvalue(f, i);
+ until name == upvalue or name == nil;
+ return value;
+ end
+ function mt.__newindex(f, upvalue, value)
+ local i, name = 0;
+ repeat
+ i = i + 1;
+ name = debug.getupvalue(f, i);
+ until name == upvalue or name == nil;
+ if name then
+ debug.setupvalue(f, i, value);
+ end
+ end
+ debug.setmetatable(function() end, mt);
+end
+
function init_global_state()
bare_sessions = {};
full_sessions = {};
@@ -415,6 +438,7 @@ read_config();
init_logging();
check_dependencies();
sandbox_require();
+set_function_metatable();
load_libraries();
init_global_state();
read_version();