mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Only set connection history if strings differ
This commit is contained in:
parent
0aafc8ae6c
commit
1f8d406658
3 changed files with 12 additions and 2 deletions
|
@ -273,8 +273,12 @@ const RecordValPtr& Connection::GetVal()
|
||||||
conn_val->AssignTime(3, start_time); // ###
|
conn_val->AssignTime(3, start_time); // ###
|
||||||
conn_val->AssignInterval(4, last_time - start_time);
|
conn_val->AssignInterval(4, last_time - start_time);
|
||||||
|
|
||||||
if ( history.size() )
|
if ( ! history.empty() )
|
||||||
conn_val->Assign(6, history);
|
{
|
||||||
|
auto v = conn_val->GetFieldAs<StringVal>(6);
|
||||||
|
if ( *v != history )
|
||||||
|
conn_val->Assign(6, history);
|
||||||
|
}
|
||||||
|
|
||||||
conn_val->SetOrigin(this);
|
conn_val->SetOrigin(this);
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,11 @@ bool String::operator==(std::string_view s) const
|
||||||
return (memcmp(b, s.data(), n) == 0);
|
return (memcmp(b, s.data(), n) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool String::operator!=(std::string_view s) const
|
||||||
|
{
|
||||||
|
return ! (*this == s);
|
||||||
|
}
|
||||||
|
|
||||||
void String::Adopt(byte_vec bytes, int len)
|
void String::Adopt(byte_vec bytes, int len)
|
||||||
{
|
{
|
||||||
Reset();
|
Reset();
|
||||||
|
|
|
@ -56,6 +56,7 @@ public:
|
||||||
bool operator==(const String& bs) const;
|
bool operator==(const String& bs) const;
|
||||||
bool operator<(const String& bs) const;
|
bool operator<(const String& bs) const;
|
||||||
bool operator==(std::string_view s) const;
|
bool operator==(std::string_view s) const;
|
||||||
|
bool operator!=(std::string_view s) const;
|
||||||
|
|
||||||
byte_vec Bytes() const { return b; }
|
byte_vec Bytes() const { return b; }
|
||||||
int Len() const { return n; }
|
int Len() const { return n; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue