summaryrefslogtreecommitdiffhomepage
path: root/module/public-core/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-04-21 18:01:05 +0000
committerSteven Barth <steven@midlink.org>2008-04-21 18:01:05 +0000
commit4963efa8522b5b491aecf2cc503a204b82caf693 (patch)
treefdb59e90c90b41988392d407c771156f358b1c3e /module/public-core/src
parentb98c0adcddf66b84dfa7e1ded0d09e17fee82279 (diff)
* ffluci.controller.public.olsr.fetch_txtinfo: Added optimizations for OLSR-le builds
Diffstat (limited to 'module/public-core/src')
-rw-r--r--module/public-core/src/controller/public/olsr.lua23
1 files changed, 12 insertions, 11 deletions
diff --git a/module/public-core/src/controller/public/olsr.lua b/module/public-core/src/controller/public/olsr.lua
index a2ce03eb3b..0e43ced49f 100644
--- a/module/public-core/src/controller/public/olsr.lua
+++ b/module/public-core/src/controller/public/olsr.lua
@@ -2,7 +2,7 @@ module("ffluci.controller.public.olsr", package.seeall)
require("ffluci.sys")
function action_index()
- local data = fetch_txtinfo()
+ local data = fetch_txtinfo("links")
if not data or not data.Links then
ffluci.template.render("public_olsr/error_olsr")
@@ -27,9 +27,9 @@ function action_index()
end
function action_routes()
- local data = fetch_txtinfo()
+ local data = fetch_txtinfo("routes")
- if not data or not data.Links then
+ if not data or not data.Routes then
ffluci.template.render("public_olsr/error_olsr")
return nil
end
@@ -52,9 +52,9 @@ function action_routes()
end
function action_topology()
- local data = fetch_txtinfo()
+ local data = fetch_txtinfo("topology")
- if not data or not data.Links then
+ if not data or not data.Topology then
ffluci.template.render("public_olsr/error_olsr")
return nil
end
@@ -69,9 +69,9 @@ function action_topology()
end
function action_hna()
- local data = fetch_txtinfo()
+ local data = fetch_txtinfo("hna")
- if not data or not data.Links then
+ if not data or not data.HNA then
ffluci.template.render("public_olsr/error_olsr")
return nil
end
@@ -86,9 +86,9 @@ function action_hna()
end
function action_mid()
- local data = fetch_txtinfo()
+ local data = fetch_txtinfo("mid")
- if not data or not data.Links then
+ if not data or not data.MID then
ffluci.template.render("public_olsr/error_olsr")
return nil
end
@@ -104,8 +104,9 @@ end
-- Internal
-function fetch_txtinfo()
- local rawdata = ffluci.sys.httpget("http://127.0.0.1:2006")
+function fetch_txtinfo(table)
+ table = table or ""
+ local rawdata = ffluci.sys.httpget("http://127.0.0.1:2006/"..table)
if #rawdata == 0 then
return nil