summaryrefslogtreecommitdiffhomepage
path: root/libs/sgi-wsapi/luasrc/sgi/wsapi.lua
diff options
context:
space:
mode:
Diffstat (limited to 'libs/sgi-wsapi/luasrc/sgi/wsapi.lua')
-rw-r--r--libs/sgi-wsapi/luasrc/sgi/wsapi.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/sgi-wsapi/luasrc/sgi/wsapi.lua b/libs/sgi-wsapi/luasrc/sgi/wsapi.lua
index 3b53025990..836295be92 100644
--- a/libs/sgi-wsapi/luasrc/sgi/wsapi.lua
+++ b/libs/sgi-wsapi/luasrc/sgi/wsapi.lua
@@ -41,6 +41,8 @@ function run(wsapi_env)
local status = 200
local x = coroutine.create(luci.dispatcher.httpdispatch)
+ local active = true
+
while id < 3 do
res, id, data1, data2 = coroutine.resume(x, r)
@@ -60,9 +62,12 @@ function run(wsapi_env)
local function iter()
local res, id, data = coroutine.resume(x)
- if id == 4 then
+ if id == 4 and active then
return data
elseif id == 5 then
+ active = false
+ return ""
+ else
return ""
end
if coroutine.status(x) == "dead" then