summaryrefslogtreecommitdiffhomepage
path: root/applications/sgi-webuci
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-05-26 09:45:12 +0000
committerSteven Barth <steven@midlink.org>2008-05-26 09:45:12 +0000
commit5f40074c0e2a6193cdd89893309787b2d31a24e4 (patch)
treea684683ae6c7834036ac80ffddeca51473c2bda9 /applications/sgi-webuci
parent1da3c32a73b384e77b5958ac601a232f462d888d (diff)
* Updated dispatcher to use fastindex if available
* Updated webuci SGI * Updated dispatcher
Diffstat (limited to 'applications/sgi-webuci')
-rw-r--r--applications/sgi-webuci/root/lib/webuci/main.lua11
-rw-r--r--applications/sgi-webuci/src/sgi/webuci.lua11
2 files changed, 11 insertions, 11 deletions
diff --git a/applications/sgi-webuci/root/lib/webuci/main.lua b/applications/sgi-webuci/root/lib/webuci/main.lua
index 478c2a94e3..cb2730d147 100644
--- a/applications/sgi-webuci/root/lib/webuci/main.lua
+++ b/applications/sgi-webuci/root/lib/webuci/main.lua
@@ -1,21 +1,20 @@
module("webuci", package.seeall)
function prepare_req(uri)
+ require("luci.dispatcher").createindex()
env = {}
env.REQUEST_URI = uri
- require("luci.dispatcher").createindex()
end
-function init_req(context)
+function handle_req(context)
env.SERVER_PROTOCOL = context.server_proto
env.REMOTE_ADDR = context.remote_addr
env.REQUEST_METHOD = context.request_method
- env.PATH_INFO = "/" .. context.uri
+ env.PATH_INFO = context.uri
env.REMOTE_PORT = context.remote_port
env.SERVER_ADDR = context.server_addr
env.SCRIPT_NAME = env.REQUEST_URI:sub(1, #env.REQUEST_URI - #env.PATH_INFO)
-end
-
-function handle_req(context)
+
+ luci.sgi.webuci.initenv(env)
luci.dispatcher.httpdispatch()
end \ No newline at end of file
diff --git a/applications/sgi-webuci/src/sgi/webuci.lua b/applications/sgi-webuci/src/sgi/webuci.lua
index 39eab3c4a2..498bca9214 100644
--- a/applications/sgi-webuci/src/sgi/webuci.lua
+++ b/applications/sgi-webuci/src/sgi/webuci.lua
@@ -25,12 +25,13 @@ limitations under the License.
]]--
module("luci.sgi.webuci", package.seeall)
--- Environment Table
-luci.http.env = webuci.env
-
-
local status_set = false
+-- Initialize the environment
+function initenv(env)
+ luci.http.env = env
+end
+
-- Returns the main dispatcher URL
function luci.http.dispatcher()
return luci.http.env.SCRIPT_NAME or ""
@@ -94,6 +95,6 @@ end
-- Sets HTTP-Status-Header
function luci.http.status(code, message)
- print(webuci.env.SERVER_PROTOCOL .. " " .. tostring(code) .. " " .. message)
+ print(luci.http.env.SERVER_PROTOCOL .. " " .. tostring(code) .. " " .. message)
status_set = true
end