mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
FileAnalysis: optimizate connection set updating.
Don't need to be checking/updating that for sequential data input, which won't be over multiple conns.
This commit is contained in:
parent
98f7907dbb
commit
c1f37dde5a
2 changed files with 8 additions and 4 deletions
|
@ -65,7 +65,9 @@ void Manager::DataIn(const u_char* data, uint64 len, AnalyzerTag::Tag tag,
|
||||||
{
|
{
|
||||||
if ( IsDisabled(tag) ) return;
|
if ( IsDisabled(tag) ) return;
|
||||||
GetFileHandle(tag, conn, is_orig);
|
GetFileHandle(tag, conn, is_orig);
|
||||||
DataIn(data, len, GetFile(current_handle, conn, tag));
|
// Sequential data input shouldn't be going over multiple conns, so don't
|
||||||
|
// do the check to update connection set.
|
||||||
|
DataIn(data, len, GetFile(current_handle, conn, tag, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::DataIn(const u_char* data, uint64 len, const string& unique)
|
void Manager::DataIn(const u_char* data, uint64 len, const string& unique)
|
||||||
|
@ -186,7 +188,7 @@ bool Manager::RemoveAnalyzer(const FileID& file_id, const RecordVal* args) const
|
||||||
}
|
}
|
||||||
|
|
||||||
File* Manager::GetFile(const string& unique, Connection* conn,
|
File* Manager::GetFile(const string& unique, Connection* conn,
|
||||||
AnalyzerTag::Tag tag)
|
AnalyzerTag::Tag tag, bool update_conn)
|
||||||
{
|
{
|
||||||
if ( unique.empty() ) return 0;
|
if ( unique.empty() ) return 0;
|
||||||
if ( IsIgnored(unique) ) return 0;
|
if ( IsIgnored(unique) ) return 0;
|
||||||
|
@ -211,7 +213,8 @@ File* Manager::GetFile(const string& unique, Connection* conn,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rval->UpdateLastActivityTime();
|
rval->UpdateLastActivityTime();
|
||||||
rval->UpdateConnectionFields(conn);
|
if ( update_conn )
|
||||||
|
rval->UpdateConnectionFields(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rval;
|
return rval;
|
||||||
|
|
|
@ -134,7 +134,8 @@ protected:
|
||||||
* fields.
|
* fields.
|
||||||
*/
|
*/
|
||||||
File* GetFile(const string& unique, Connection* conn = 0,
|
File* GetFile(const string& unique, Connection* conn = 0,
|
||||||
AnalyzerTag::Tag tag = AnalyzerTag::Error);
|
AnalyzerTag::Tag tag = AnalyzerTag::Error,
|
||||||
|
bool update_conn = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the File object mapped to \a file_id, or a null pointer if no
|
* @return the File object mapped to \a file_id, or a null pointer if no
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue