luci.httpd.module.Handler.__init__(self)
self.limit = limit or 5
self.running = {}
- setmetatable(self.running, {__mode = "v"})
+ setmetatable(self.running, {__mode = "k"})
end
function Luci.handle_head(self, ...)
end
function Luci.handle_get(self, request, sourcein, sinkerr)
- if self.limit and #self.running >= self.limit then
- return self:failure(503, "Overload")
- end
- table.insert(self.running, coroutine.running())
-
local r = luci.http.Request(
request.env,
sourcein,
return true
elseif id == 5 then
active = false
- return true
+
+ while (coroutine.resume(x)) do
+ end
+
+ return nil
elseif id == 4 then
return data
end
end
end
- headers["Expires"] = luci.http.protocol.date.to_http( os.time() )
- headers["Date"] = headers["Expires"]
- headers["Cache-Control"] = "no-cache"
-
return Response(status, headers), iter
end