aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2021-11-02 21:15:53 +0100
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2021-11-02 21:15:53 +0100
commitd17db4b3ff1d84830d41ad0d406bfc3174d95018 (patch)
tree009ae8064e5f4df2573d16f7f8e20dc7d1b54a35 /lualib/lua_scanners
parenta4509c7387f5b7297d951ce8679df9d5b00c8f5d (diff)
downloadrspamd-d17db4b3ff1d84830d41ad0d406bfc3174d95018.tar.gz
rspamd-d17db4b3ff1d84830d41ad0d406bfc3174d95018.zip
[Minor] lua_scanners - icap - lua linting
Diffstat (limited to 'lualib/lua_scanners')
-rw-r--r--lualib/lua_scanners/icap.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/lualib/lua_scanners/icap.lua b/lualib/lua_scanners/icap.lua
index 414b81c55..e10cf886e 100644
--- a/lualib/lua_scanners/icap.lua
+++ b/lualib/lua_scanners/icap.lua
@@ -272,7 +272,7 @@ local function icap_check(task, content, digest, rule, maybe_part)
local resp_http_headers
-- Append all extra headers
- if rule.user_agent ~= "none" then
+ if rule.user_agent ~= "none" then
table.insert(respond_headers, string.format("User-Agent: %s\r\n", rule.user_agent))
end
@@ -472,7 +472,6 @@ local function icap_check(task, content, digest, rule, maybe_part)
icap_requery(err_m, "icap_r_respond_http_cb")
else
local result = tostring(data)
- connection:close()
local icap_http_headers = result_header_table(result) or {}
-- Find HTTP/[12].x [234]xx response
@@ -550,16 +549,16 @@ local function icap_check(task, content, digest, rule, maybe_part)
end
end
- local function icap_w_respond_cb(err_m, conn)
- if err_m or conn == nil then
+ local function icap_w_respond_cb(err_m, connection)
+ if err_m or connection == nil then
icap_requery(err_m, "icap_w_respond_cb")
else
- conn:add_read(icap_r_respond_cb, '\r\n\r\n')
+ connection:add_read(icap_r_respond_cb, '\r\n\r\n')
end
end
- local function icap_r_options_cb(err_m, data, conn)
- if err_m or conn == nil then
+ local function icap_r_options_cb(err_m, data, connection)
+ if err_m or connection == nil then
icap_requery(err_m, "icap_r_options_cb")
else
local icap_headers = result_header_table(tostring(data))
@@ -592,7 +591,7 @@ local function icap_check(task, content, digest, rule, maybe_part)
end
- conn:add_write(icap_w_respond_cb, get_respond_query())
+ connection:add_write(icap_w_respond_cb, get_respond_query())
else
rspamd_logger.errx(task, '%s: RESPMOD method not advertised: Methods: %s',