summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-06-23 18:17:02 +0000
committerSteven Barth <steven@midlink.org>2008-06-23 18:17:02 +0000
commit4f630d647c7191ac9d8fd2dfcc8e93746faf391a (patch)
tree76bb12773e833e38c69ee43f006b78f0e84ab748 /libs/web
parenta038da390d7fd3a75b5a1045afbb4d9782556c57 (diff)
* Introducing LuCI HTTPD as testing environment
* Several coroutine-safety fixes
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua6
-rw-r--r--libs/web/luasrc/http.lua5
2 files changed, 6 insertions, 5 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index f5894bffc..60178741e 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -267,7 +267,7 @@ function createtree()
luci.i18n.loadc("default")
local scope = luci.util.clone(_G)
- for k,v in pairs(_M) do
+ for k,v in pairs(luci.dispatcher) do
if type(v) == "function" then
scope[k] = v
end
@@ -276,10 +276,10 @@ function createtree()
for k, v in pairs(index) do
scope._NAME = k
setfenv(v, scope)
-
+
local stat, err = luci.util.copcall(v)
if not stat then
- error500(err)
+ error500("createtree failed: " .. k .. ": " .. err)
os.exit(1)
end
end
diff --git a/libs/web/luasrc/http.lua b/libs/web/luasrc/http.lua
index 2bd914429..5263bfaad 100644
--- a/libs/web/luasrc/http.lua
+++ b/libs/web/luasrc/http.lua
@@ -53,13 +53,14 @@ function Request.__init__(self, env, sourcein, sinkerr)
setmetatable(self.message.params, {__index =
function(tbl, key)
+ setmetatable(tbl, nil)
+
luci.http.protocol.parse_message_body(
self.input,
self.message,
self.filehandler
)
-
- setmetatable(tbl, nil)
+
return rawget(tbl, key)
end
})