mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Remove FileAnalysis::postpone_timeout.
FileAnalysis::set_timeout_interval can now perform same function.
This commit is contained in:
parent
bc5cd3acc8
commit
16f924c2c0
6 changed files with 7 additions and 43 deletions
|
@ -120,7 +120,9 @@ export {
|
|||
|
||||
## Sets the *timeout_interval* field of :bro:see:`fa_file`, which is
|
||||
## used to determine the length of inactivity that is allowed for a file
|
||||
## before internal state related to it is cleaned up.
|
||||
## before internal state related to it is cleaned up. When used within a
|
||||
## :bro:see:`file_timeout` handler, the analysis will delay timing out
|
||||
## again for the period specified by *t*.
|
||||
##
|
||||
## f: the file.
|
||||
##
|
||||
|
@ -130,18 +132,6 @@ export {
|
|||
## for the *id* isn't currently active.
|
||||
global set_timeout_interval: function(f: fa_file, t: interval): bool;
|
||||
|
||||
## Postpones the timeout of file analysis for a given file.
|
||||
## When used within a :bro:see:`file_timeout` handler for, the analysis
|
||||
## the analysis will delay timing out for the period of time indicated by
|
||||
## the *timeout_interval* field of :bro:see:`fa_file`, which can be set
|
||||
## with :bro:see:`FileAnalysis::set_timeout_interval`.
|
||||
##
|
||||
## f: the file.
|
||||
##
|
||||
## Returns: true if the timeout will be postponed, or false if analysis
|
||||
## for the *id* isn't currently active.
|
||||
global postpone_timeout: function(f: fa_file): bool;
|
||||
|
||||
## Adds an analyzer to the analysis of a given file.
|
||||
##
|
||||
## f: the file.
|
||||
|
@ -207,11 +197,6 @@ function set_timeout_interval(f: fa_file, t: interval): bool
|
|||
return __set_timeout_interval(f$id, t);
|
||||
}
|
||||
|
||||
function postpone_timeout(f: fa_file): bool
|
||||
{
|
||||
return __postpone_timeout(f$id);
|
||||
}
|
||||
|
||||
function add_analyzer(f: fa_file, args: AnalyzerArgs): bool
|
||||
{
|
||||
if ( ! __add_analyzer(f$id, args) ) return F;
|
||||
|
|
|
@ -27,13 +27,6 @@ enum Analyzer %{
|
|||
ANALYZER_DATA_EVENT,
|
||||
%}
|
||||
|
||||
## :bro:see:`FileAnalysis::postpone_timeout`.
|
||||
function FileAnalysis::__postpone_timeout%(file_id: string%): bool
|
||||
%{
|
||||
bool result = file_mgr->PostponeTimeout(file_id->CheckString());
|
||||
return new Val(result, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
## :bro:see:`FileAnalysis::set_timeout_interval`.
|
||||
function FileAnalysis::__set_timeout_interval%(file_id: string, t: interval%): bool
|
||||
%{
|
||||
|
|
|
@ -153,17 +153,6 @@ void Manager::SetSize(uint64 size, AnalyzerTag::Tag tag, Connection* conn,
|
|||
RemoveFile(file->GetID());
|
||||
}
|
||||
|
||||
bool Manager::PostponeTimeout(const string& file_id) const
|
||||
{
|
||||
File* file = Lookup(file_id);
|
||||
|
||||
if ( ! file )
|
||||
return false;
|
||||
|
||||
file->postpone_timeout = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Manager::SetTimeoutInterval(const string& file_id, double interval) const
|
||||
{
|
||||
File* file = Lookup(file_id);
|
||||
|
@ -171,6 +160,9 @@ bool Manager::SetTimeoutInterval(const string& file_id, double interval) const
|
|||
if ( ! file )
|
||||
return false;
|
||||
|
||||
if ( interval > 0 )
|
||||
file->postpone_timeout = true;
|
||||
|
||||
file->SetTimeoutInterval(interval);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -88,12 +88,6 @@ public:
|
|||
*/
|
||||
bool IgnoreFile(const string& file_id);
|
||||
|
||||
/**
|
||||
* If called during a \c file_timeout event handler, requests deferral of
|
||||
* analysis timeout.
|
||||
*/
|
||||
bool PostponeTimeout(const string& file_id) const;
|
||||
|
||||
/**
|
||||
* Set's an inactivity threshold for the file.
|
||||
*/
|
||||
|
|
|
@ -20,7 +20,7 @@ redef default_file_timeout_interval = 2sec;
|
|||
event file_timeout(f: fa_file)
|
||||
{
|
||||
if ( timeout_cnt < 1 )
|
||||
FileAnalysis::postpone_timeout(f);
|
||||
FileAnalysis::set_timeout_interval(f, f$timeout_interval);
|
||||
else
|
||||
terminate();
|
||||
++timeout_cnt;
|
Loading…
Add table
Add a link
Reference in a new issue