projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
048fe5c
)
Fixed occasionally occuring "Overload"-problems with luci-httpd
author
Steven Barth
<steven@midlink.org>
Tue, 2 Sep 2008 15:03:18 +0000
(15:03 +0000)
committer
Steven Barth
<steven@midlink.org>
Tue, 2 Sep 2008 15:03:18 +0000
(15:03 +0000)
libs/httpd/luasrc/httpd/handler/luci.lua
patch
|
blob
|
history
diff --git
a/libs/httpd/luasrc/httpd/handler/luci.lua
b/libs/httpd/luasrc/httpd/handler/luci.lua
index
737abd4
..
c3720ff
100644
(file)
--- a/
libs/httpd/luasrc/httpd/handler/luci.lua
+++ b/
libs/httpd/luasrc/httpd/handler/luci.lua
@@
-41,7
+41,15
@@
end
function Luci.handle_get(self, request, sourcein, sinkerr)
if self.limit and #self.running >= self.limit then
function Luci.handle_get(self, request, sourcein, sinkerr)
if self.limit and #self.running >= self.limit then
- return self:failure(503, "Overload")
+ for k, v in ipairs(self.running) do
+ if coroutine.status(v) == "dead" then
+ collectgarbage()
+ break
+ end
+ end
+ if #self.running >= self.limit then
+ return self:failure(503, "Overload")
+ end
end
table.insert(self.running, coroutine.running())
end
table.insert(self.running, coroutine.running())
@@
-84,6
+92,10
@@
function Luci.handle_get(self, request, sourcein, sinkerr)
return true
elseif id == 5 then
active = false
return true
elseif id == 5 then
active = false
+
+ while (coroutine.resume(x)) do
+ end
+
return nil
elseif id == 4 then
return data
return nil
elseif id == 4 then
return data