Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFLATE: data error #3

Open
poembro opened this issue Oct 26, 2018 · 0 comments
Open

INFLATE: data error #3

poembro opened this issue Oct 26, 2018 · 0 comments

Comments

@poembro
Copy link

poembro commented Oct 26, 2018

my code

function _M:inflategzip(is_zip, zip_total_size, body)
    if is_zip and is_zip == true then  
        local chunk = 16384 
        local output_table = {}  
        local count = 0
        
        local input = function(bufsize)  
            local start = count > 0 and bufsize*count or 1  
            local datas = body:sub(start, (bufsize*(count+1)-1) )  
            count = count + 1
            return datas
        end  
        
        local output_table = {}  
        local output = function(data)  
            table_insert(output_table, data)  
        end
        
        local ok, err = zlib.inflateGzip(input, output, chunk)
        if not ok then  
             ngx.log(ngx.ERR, "--> zlib error---- ", err)
        end
        
        body = table_concat(output_table,'')  
        
        if  string_len(body) ~= zip_total_size then
            ngx.log(ngx.ERR, "-->  error 2---- ", err)
        end 
        return body
    end
    
    return body
end

nginx_error.log 文件中出现

2018/10/26 19:11:16 [error] 6411#0: *2631471 [lua] soft.lua:179: inflategzip(): --> zlib error---- INFLATE: data error, client: 106.32.216.112, server: -, request: "GET /socket?order=23243 HTTP/1.1", host: "gamewaf.23af.com"

@poembro poembro changed the title 在解压过程中出现 INFLATE: data error INFLATE: data error Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant