浏览代码

[Minor] Ratelimit: Fix formatting issue

tags/3.0
Vsevolod Stakhov 3 年前
父节点
当前提交
ff07415a3b
共有 2 个文件被更改,包括 10 次插入5 次删除
  1. 4
    2
      src/lua/lua_mempool.c
  2. 6
    3
      src/plugins/lua/reputation.lua

+ 4
- 2
src/lua/lua_mempool.c 查看文件

@@ -524,8 +524,10 @@ lua_mempool_get_variable (lua_State *L)

return nvar;
}

lua_pushstring (L, value);
else {
/* No type specified, return string */
lua_pushstring(L, value);
}
}
else {
lua_pushnil (L);

+ 6
- 3
src/plugins/lua/reputation.lua 查看文件

@@ -411,19 +411,22 @@ local function ip_reputation_filter(task, rule)
if asn_stats then
local asn_score = generic_reputation_calc(asn_stats, rule, cfg.scores.asn, task)
score = score + asn_score
table.insert(description_t, string.format('asn: %s(%.2f)', asn, asn_score))
table.insert(description_t, string.format('asn: %s(%.2f)',
asn, asn_score))
end
if country_stats then
local country_score = generic_reputation_calc(country_stats, rule,
cfg.scores.country, task)
score = score + country_score
table.insert(description_t, string.format('country: %s(%.2f)', country, country_score))
table.insert(description_t, string.format('country: %s(%.2f)',
country, country_score))
end
if ip_stats then
local ip_score = generic_reputation_calc(ip_stats, rule, cfg.scores.ip,
task)
score = score + ip_score
table.insert(description_t, string.format('ip: %s(%.2f)', ip, ip_score))
table.insert(description_t, string.format('ip: %s(%.2f)',
tostring(ip), ip_score))
end

if math.abs(score) > 0.001 then

正在加载...
取消
保存