mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
FileAnalysis: finish switching hooks to events.
This commit is contained in:
parent
641154f8e8
commit
a2d9b47bcd
39 changed files with 219 additions and 305 deletions
|
@ -16,17 +16,13 @@ redef test_get_file_name = function(f: fa_file): string
|
|||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
hook FileAnalysis::policy(trig: FileAnalysis::Trigger, f: fa_file)
|
||||
event file_new(f: fa_file)
|
||||
{
|
||||
if ( trig != FileAnalysis::TRIGGER_NEW ) return;
|
||||
|
||||
f$timeout_interval=2sec;
|
||||
f$timeout_interval = 2sec;
|
||||
}
|
||||
|
||||
hook FileAnalysis::policy(trig: FileAnalysis::Trigger, f: fa_file)
|
||||
event file_timeout(f: fa_file)
|
||||
{
|
||||
if ( trig != FileAnalysis::TRIGGER_TIMEOUT ) return;
|
||||
|
||||
if ( timeout_cnt < 1 )
|
||||
FileAnalysis::postpone_timeout(f);
|
||||
else
|
||||
|
|
|
@ -8,9 +8,8 @@ redef test_get_file_name = function(f: fa_file): string
|
|||
return fmt("%s-file", f$id);
|
||||
};
|
||||
|
||||
hook FileAnalysis::policy(trig: FileAnalysis::Trigger, f: fa_file)
|
||||
event file_type(f: fa_file)
|
||||
{
|
||||
if ( trig != FileAnalysis::TRIGGER_TYPE ) return;
|
||||
for ( act in test_file_actions )
|
||||
FileAnalysis::remove_action(f, act);
|
||||
local filename = test_get_file_name(f);
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
# @TEST-EXEC: btest-diff get.out
|
||||
# @TEST-EXEC: test ! -s Cx92a0ym5R8-file
|
||||
|
||||
hook FileAnalysis::policy(trig: FileAnalysis::Trigger, f: fa_file)
|
||||
event file_new(f: fa_file)
|
||||
{
|
||||
if ( trig != FileAnalysis::TRIGGER_NEW ) return;
|
||||
FileAnalysis::stop(f);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue