Authored by chunhua.zhang

remove unused

... ... @@ -4,9 +4,6 @@ _G[modname]=M
package.loaded[modname]=M
local cjson=require "cjson"
local rate_limit = require "limit_common_flow"
local iptool=require "iptool"
local lrucache = require "resty.lrucache"
local http_request = require "http_request"
... ... @@ -14,21 +11,6 @@ local cache=lua_context.mal_ip_cache
local redis_limit_ip=lua_context["redis_limit_ip"]
function M.in_array(value,arr)
if not value then
return false
end
if not arr then
return false
end
for k, v in ipairs(arr) do
if value==v then
return true
end
end
return false
end
-- mal ip controller api --------
function M:mal_ip()
... ... @@ -38,7 +20,7 @@ function M:mal_ip()
ngx.header["Content-type"]="application/json;charset=utf-8"
if not method then
ngx.say('{"code": 400, "msg": "params error!"}')
ngx.exit(ngx.HTTP_OK)
ngx.exit(ngx.HTTP_OK)
end
local exists={}
if method == 'pubAdd' then
... ... @@ -57,7 +39,7 @@ function M:mal_ip()
t.type="flush"
redis_limit_ip:cmd("publish","mal_ips",cjson.encode(t))
elseif method == 'queryAll' then
local all_ips=cache:get_keys(0)
local all_ips=cache:get_keys(0)
for i,v in pairs(all_ips) do
exists[#exists+1]=string.sub(v,8,string.len(v))
end
... ...