[luci] bugfix to make luci.json.encode() work like expected

This commit is contained in:
Bart Van Der Meerssche 2011-04-16 12:49:03 +02:00
parent 216c10202b
commit 2faf05b58f
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ function encode(obj, ...)
repeat
chnk, err = e()
out[#out+1] = chnk
until chnk
until not chnk
return not err and table.concat(out) or nil
end
@ -141,7 +141,7 @@ end
function Encoder.put(self, chunk)
if self.buffersize < 2 then
corountine.yield(chunk)
coroutine.yield(chunk)
else
if #self.buffer + #chunk > self.buffersize then
local written = 0