libs/lucid-http: prepare external indexing and tree building in luci handler
[project/luci.git] / libs / lucid-http / luasrc / lucid / http / handler / luci.lua
index d816aae13bb6a31c0eb22476451b55a5e6df7f42..8f203e163f8725db5ef632ec08cfb24d0378f3a3 100644 (file)
@@ -11,6 +11,7 @@ You may obtain a copy of the License at
 $Id$
 ]]--
 
 $Id$
 ]]--
 
+local cbi = require "luci.cbi"
 local dsp = require "luci.dispatcher"
 local util = require "luci.util"
 local http = require "luci.http"
 local dsp = require "luci.dispatcher"
 local util = require "luci.util"
 local http = require "luci.http"
@@ -33,6 +34,8 @@ Luci = util.class(srv.Handler)
 function Luci.__init__(self, name, prefix)
        srv.Handler.__init__(self, name)
        self.prefix = prefix
 function Luci.__init__(self, name, prefix)
        srv.Handler.__init__(self, name)
        self.prefix = prefix
+
+       self.dsp_tree = dsp.createtree()
 end
 
 --- Handle a HEAD request.
 end
 
 --- Handle a HEAD request.
@@ -66,7 +69,7 @@ function Luci.handle_GET(self, request, sourcein)
 
        local x = coroutine.create(dsp.httpdispatch)
        while not id or id < 3 do
 
        local x = coroutine.create(dsp.httpdispatch)
        while not id or id < 3 do
-               res, id, data1, data2 = coroutine.resume(x, r, self.prefix)
+               res, id, data1, data2 = coroutine.resume(x, r, self.prefix, self.dsp_tree)
 
                if not res then
                        status = 500
 
                if not res then
                        status = 500