Fix sgi-wsapi and sgi-luci to be standards compliant
This commit is contained in:
parent
7a08658fe7
commit
59bef00fc3
2 changed files with 12 additions and 6 deletions
|
@ -84,10 +84,13 @@ function Luci.handle_get(self, request, sourcein, sinkerr)
|
||||||
elseif not id then
|
elseif not id then
|
||||||
return true
|
return true
|
||||||
elseif id == 5 then
|
elseif id == 5 then
|
||||||
return nil
|
return true
|
||||||
else
|
elseif id == 4 then
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
|
if coroutine.status(x) == "dead" then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
headers["Expires"] = luci.http.protocol.date.to_http( os.time() )
|
headers["Expires"] = luci.http.protocol.date.to_http( os.time() )
|
||||||
|
|
|
@ -59,11 +59,14 @@ function run(wsapi_env)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function iter()
|
local function iter()
|
||||||
local res, id, data1, data2 = coroutine.resume(x)
|
local res, id, data = coroutine.resume(x)
|
||||||
if not res or id == 5 then
|
if id == 4 then
|
||||||
|
return data
|
||||||
|
elseif id == 5 then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
if coroutine.status(x) == "dead" then
|
||||||
return nil
|
return nil
|
||||||
else
|
|
||||||
return data1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue