summaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners/avast.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lualib/lua_scanners/avast.lua')
-rw-r--r--lualib/lua_scanners/avast.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/lualib/lua_scanners/avast.lua b/lualib/lua_scanners/avast.lua
index 16c838dbc..da8e6d710 100644
--- a/lualib/lua_scanners/avast.lua
+++ b/lualib/lua_scanners/avast.lua
@@ -81,7 +81,7 @@ local function avast_config(opts)
return nil
end
-local function avast_check(task, content, digest, rule)
+local function avast_check(task, content, digest, rule, maybe_part)
local function avast_check_uncached ()
local upstream = rule.upstreams:get_upstream_round_robin()
local addr = upstream:get_addr()
@@ -148,7 +148,7 @@ local function avast_check(task, content, digest, rule)
'%s [%s]: failed to scan, maximum retransmits exceed',
rule['symbol'], rule['type'])
common.yield_result(task, rule, 'failed to scan and retransmits exceed',
- 0.0, 'fail')
+ 0.0, 'fail', maybe_part)
return
end
@@ -251,7 +251,7 @@ local function avast_check(task, content, digest, rule)
if vname then
vname = vname:gsub('\\ ', ' '):gsub('\\\\', '\\')
- common.yield_result(task, rule, vname)
+ common.yield_result(task, rule, vname, 1.0, nil, maybe_part)
cached = vname
end
end
@@ -263,12 +263,12 @@ local function avast_check(task, content, digest, rule)
if ret then
rspamd_logger.errx(task, '%s: error: %s', rule.log_prefix, ret[1][2])
common.yield_result(task, rule, 'error:' .. ret[1][2],
- 0.0, 'fail')
+ 0.0, 'fail', maybe_part)
end
end
if cached then
- common.save_cache(task, digest, rule, cached)
+ common.save_cache(task, digest, rule, cached, 1.0, maybe_part)
else
-- Unexpected reply
rspamd_logger.errx(task, '%s: unexpected reply: %s', rule.log_prefix, mdata)
@@ -286,7 +286,8 @@ local function avast_check(task, content, digest, rule)
maybe_retransmit()
end
- if common.condition_check_and_continue(task, content, rule, digest, avast_check_uncached) then
+ if common.condition_check_and_continue(task, content, rule, digest,
+ avast_check_uncached, maybe_part) then
return
else
avast_check_uncached()
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398