]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] lua_scanners - icap - restart from scratch on requery / stop early on failed... 3960/head
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Thu, 4 Nov 2021 17:37:27 +0000 (18:37 +0100)
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>
Thu, 4 Nov 2021 17:37:27 +0000 (18:37 +0100)
lualib/lua_scanners/icap.lua

index 0bca81a971fd9e46e7885b1a5627b25b45268a05..d2a418fb17fe2b73d992086895a32af38200852b 100644 (file)
@@ -223,6 +223,8 @@ local function icap_check(task, content, digest, rule, maybe_part)
 
           tcp_options.host = addr:to_string()
           tcp_options.port = addr:get_port()
+          tcp_options.callback = icap_callback
+          tcp_options.data = options_request
 
           tcp.request(tcp_options)
 
@@ -408,6 +410,7 @@ local function icap_check(task, content, digest, rule, maybe_part)
                 '%s: icap error X-Infection-Found: %s', rule.log_prefix, icap_threat)
             common.yield_result(task, rule, icap_threat, 0,
                 'fail', maybe_part)
+            return true
           else
             lua_util.debugm(rule.name, task,
                 '%s: icap X-Infection-Found: %s', rule.log_prefix, icap_threat)