commit e273a7d: [Minor] Fix lua warnings

Carsten Rosenberg c.rosenberg at heinlein-support.de
Fri Oct 4 10:42:25 UTC 2019


Author: Carsten Rosenberg
Date: 2019-10-01 21:00:17 +0200
URL: https://github.com/rspamd/rspamd/commit/e273a7d2cb8a94949e5aaf6b8efd9b78b7c6a17e

[Minor] Fix lua warnings

---
 lualib/lua_scanners/icap.lua     | 14 +++++++-------
 lualib/lua_scanners/oletools.lua |  3 ++-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lualib/lua_scanners/icap.lua b/lualib/lua_scanners/icap.lua
index 8312d20b9..92187fb76 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 88ecfdece..1f861f6a7 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


More information about the Commits mailing list