Authored by chunhua.zhang

more

... ... @@ -153,18 +153,31 @@ function main()
init_read_body()
--cutdown version check
pcall(cutdown)
local status, errMsg = pcall(cutdown)
if not status then
ngx.log(ngx.ERR, "call method [cutdown] failed.", errMsg)
end
-- check white ip
local status, ret = pcall(is_white);
if status and ret then
local ret = false
status, errMsg, ret = pcall(is_white);
if not status then
ngx.log(ngx.ERR, "call method [is_white] failed.", errMsg)
elseif ret then
return
end
-- check malIP and limit
pcall(check_malIp)
pcall(rate_limit)
status, errMsg = pcall(check_malIp)
if not status then
ngx.log(ngx.ERR, "call method [check_malIp] failed.", errMsg)
end
status, errMsg = pcall(rate_limit)
if not status then
ngx.log(ngx.ERR, "call method [rate_limit] failed.", errMsg)
end
end
----- running ----
... ...