using ffizlib in lua, android response 500 error , web browser none error

29 katselukertaa
Siirry ensimmäiseen lukemattomaan viestiin

fc1...@gmail.com

lukematon,
12.11.2018 klo 5.23.4112.11.2018
vastaanottaja openresty-en
using ffizlib in lua, android response 500 error , web browser none error

the code:
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 = body:sub(start, (bufsize*(count+1)-1))  
if data == "" then  
data = nil  
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)


error:

attempt to call global 'table_insert' (a nil value), at the up code output function.

Max D. Bellasys

lukematon,
19.11.2018 klo 20.22.2919.11.2018
vastaanottaja openresty-en
Just looking at your code and the error... table_insert isn’t defined in the code.

Did you mean table.insert(...) per Lua syntax?

I hand-rolled FFI + zlib + C++ application before, so I was not familiar with ffizlib module- maybe this is a standard method?

Please clarify
Vastaa kaikille
Vastaa kirjoittajalle
Välitä
Viesti on poistettu
0 uutta viestiä