lua中使用ffizlib,浏览器访问没问题,安卓okhttp访问报错500,代码如下
local chunk =16384 --#resbody
ngx_log(ngx_INFO,"chunk:",chunk)
local count = 0
local input = function(bufsize)
local start = count > 0 and bufsize*count or 1
local data = "" (bufsize*(count+1)-1))
if data == "" then
data = "">
end
count = count + 1
return data
end
local output_table = {}
local output = function(data)
table_insert(output_table, data)
end
ngx_log(ngx_INFO,"ffizlib.deflateGzip start")
local ok, err = ffizlib.deflateGzip(input, output, chunk)
报错信息:
attempt to call global 'table_insert' (a nil value),上面代码的output部分。