From: Carsten Rosenberg Date: Tue, 1 Oct 2019 19:00:17 +0000 (+0200) Subject: [Minor] Fix lua warnings X-Git-Tag: 2.0~74^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e273a7d2cb8a94949e5aaf6b8efd9b78b7c6a17e;p=thirdparty%2Frspamd.git [Minor] Fix lua warnings --- diff --git a/lualib/lua_scanners/icap.lua b/lualib/lua_scanners/icap.lua index 8312d20b94..92187fb76f 100644 --- a/lualib/lua_scanners/icap.lua +++ b/lualib/lua_scanners/icap.lua @@ -285,8 +285,8 @@ local function icap_check(task, content, digest, rule) end end - local function icap_r_respond_cb(err, data, conn) - if err or conn == nil then + local function icap_r_respond_cb(error, data, connection) + if error or connection == nil then icap_requery(err, "icap_r_respond_cb") else local result = tostring(data) @@ -315,16 +315,16 @@ local function icap_check(task, content, digest, rule) end end - local function icap_w_respond_cb(err, conn) - if err or conn == nil then + local function icap_w_respond_cb(error, connection) + if error or connection == nil then icap_requery(err, "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, data, conn) - if err or conn == nil then + local function icap_r_options_cb(error, data, connection) + if error or connection == nil then icap_requery(err, "icap_r_options_cb") else local icap_headers = icap_result_header_table(tostring(data)) diff --git a/lualib/lua_scanners/oletools.lua b/lualib/lua_scanners/oletools.lua index 88ecfdece6..1f861f6a75 100644 --- a/lualib/lua_scanners/oletools.lua +++ b/lualib/lua_scanners/oletools.lua @@ -195,7 +195,8 @@ local function oletools_check(task, content, digest, rule) rspamd_logger.errx(task, '%s: Error message: %s', rule.log_prefix, result[2]['message']) oletools_requery(oletools_rc[result[3]['return_code']]) - elseif type(result[2]['analysis']) == 'table' and #result[2]['analysis'] == 0 and #result[2]['macros'] == 0 then + elseif type(result[2]['analysis']) == 'table' and #result[2]['analysis'] == 0 + and #result[2]['macros'] == 0 then rspamd_logger.warnx(task, '%s: maybe unhandled python or oletools error', rule.log_prefix) common.yield_result(task, rule, 'oletools unhandled error', 0.0, 'fail') elseif type(result[2]['analysis']) ~= 'table' and #result[2]['macros'] == 0 then