]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix lua warnings
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Tue, 1 Oct 2019 19:00:17 +0000 (21:00 +0200)
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Tue, 1 Oct 2019 19:00:17 +0000 (21:00 +0200)
lualib/lua_scanners/icap.lua
lualib/lua_scanners/oletools.lua

index 8312d20b9451930c9c959c256f974e76277a6353..92187fb76fb4c8233066bba41b0b3e09c652089d 100644 (file)
@@ -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))
index 88ecfdece6b5ab9e195ca784c0b483e0f37db40c..1f861f6a75eb8bdea5907f80b82dd227e25bf98c 100644 (file)
@@ -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