mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Ok, this one is not really necessary for 2.1 and more of a nice-to-have
Before this patch, empty values were not hashed at all. Which had the unfortunate side-effect that e.g. the lines TEST - and - TEST have the same hash values. On re-reads that means that the change will be ignored. This is probably pretty academic, but this patch changes it and adds a testcase. Output of the reread test changes due to re-ordering of the output (probably due to the fact that the internal hash values are changed and thus transferred in a different order)
This commit is contained in:
parent
fbe464ffa3
commit
7e46936728
4 changed files with 382 additions and 127 deletions
|
@ -0,0 +1,155 @@
|
|||
============PREDICATE============
|
||||
Input::EVENT_NEW
|
||||
[i=1]
|
||||
[s=<uninitialized>, ss=TEST]
|
||||
============PREDICATE============
|
||||
Input::EVENT_NEW
|
||||
[i=2]
|
||||
[s=<uninitialized>, ss=<uninitialized>]
|
||||
============EVENT============
|
||||
Description
|
||||
[source=../input.log, reader=Input::READER_ASCII, mode=Input::REREAD, name=ssh, destination={
|
||||
[2] = [s=<uninitialized>, ss=<uninitialized>],
|
||||
[1] = [s=<uninitialized>, ss=TEST]
|
||||
}, idx=<no value description>, val=<no value description>, want_record=T, ev=line
|
||||
{
|
||||
print A::outfile, ============EVENT============;
|
||||
print A::outfile, Description;
|
||||
print A::outfile, A::description;
|
||||
print A::outfile, Type;
|
||||
print A::outfile, A::tpe;
|
||||
print A::outfile, Left;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, Right;
|
||||
print A::outfile, A::right;
|
||||
}, pred=anonymous-function
|
||||
{
|
||||
print A::outfile, ============PREDICATE============;
|
||||
print A::outfile, A::typ;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, A::right;
|
||||
return (T);
|
||||
}, config={
|
||||
|
||||
}]
|
||||
Type
|
||||
Input::EVENT_NEW
|
||||
Left
|
||||
[i=1]
|
||||
Right
|
||||
[s=<uninitialized>, ss=TEST]
|
||||
============EVENT============
|
||||
Description
|
||||
[source=../input.log, reader=Input::READER_ASCII, mode=Input::REREAD, name=ssh, destination={
|
||||
[2] = [s=<uninitialized>, ss=<uninitialized>],
|
||||
[1] = [s=<uninitialized>, ss=TEST]
|
||||
}, idx=<no value description>, val=<no value description>, want_record=T, ev=line
|
||||
{
|
||||
print A::outfile, ============EVENT============;
|
||||
print A::outfile, Description;
|
||||
print A::outfile, A::description;
|
||||
print A::outfile, Type;
|
||||
print A::outfile, A::tpe;
|
||||
print A::outfile, Left;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, Right;
|
||||
print A::outfile, A::right;
|
||||
}, pred=anonymous-function
|
||||
{
|
||||
print A::outfile, ============PREDICATE============;
|
||||
print A::outfile, A::typ;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, A::right;
|
||||
return (T);
|
||||
}, config={
|
||||
|
||||
}]
|
||||
Type
|
||||
Input::EVENT_NEW
|
||||
Left
|
||||
[i=2]
|
||||
Right
|
||||
[s=<uninitialized>, ss=<uninitialized>]
|
||||
==========SERVERS============
|
||||
{
|
||||
[2] = [s=<uninitialized>, ss=<uninitialized>],
|
||||
[1] = [s=<uninitialized>, ss=TEST]
|
||||
}
|
||||
============PREDICATE============
|
||||
Input::EVENT_CHANGED
|
||||
[i=1]
|
||||
[s=TEST, ss=<uninitialized>]
|
||||
============PREDICATE============
|
||||
Input::EVENT_CHANGED
|
||||
[i=2]
|
||||
[s=TEST, ss=TEST]
|
||||
============EVENT============
|
||||
Description
|
||||
[source=../input.log, reader=Input::READER_ASCII, mode=Input::REREAD, name=ssh, destination={
|
||||
[2] = [s=TEST, ss=TEST],
|
||||
[1] = [s=TEST, ss=<uninitialized>]
|
||||
}, idx=<no value description>, val=<no value description>, want_record=T, ev=line
|
||||
{
|
||||
print A::outfile, ============EVENT============;
|
||||
print A::outfile, Description;
|
||||
print A::outfile, A::description;
|
||||
print A::outfile, Type;
|
||||
print A::outfile, A::tpe;
|
||||
print A::outfile, Left;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, Right;
|
||||
print A::outfile, A::right;
|
||||
}, pred=anonymous-function
|
||||
{
|
||||
print A::outfile, ============PREDICATE============;
|
||||
print A::outfile, A::typ;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, A::right;
|
||||
return (T);
|
||||
}, config={
|
||||
|
||||
}]
|
||||
Type
|
||||
Input::EVENT_CHANGED
|
||||
Left
|
||||
[i=1]
|
||||
Right
|
||||
[s=<uninitialized>, ss=TEST]
|
||||
============EVENT============
|
||||
Description
|
||||
[source=../input.log, reader=Input::READER_ASCII, mode=Input::REREAD, name=ssh, destination={
|
||||
[2] = [s=TEST, ss=TEST],
|
||||
[1] = [s=TEST, ss=<uninitialized>]
|
||||
}, idx=<no value description>, val=<no value description>, want_record=T, ev=line
|
||||
{
|
||||
print A::outfile, ============EVENT============;
|
||||
print A::outfile, Description;
|
||||
print A::outfile, A::description;
|
||||
print A::outfile, Type;
|
||||
print A::outfile, A::tpe;
|
||||
print A::outfile, Left;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, Right;
|
||||
print A::outfile, A::right;
|
||||
}, pred=anonymous-function
|
||||
{
|
||||
print A::outfile, ============PREDICATE============;
|
||||
print A::outfile, A::typ;
|
||||
print A::outfile, A::left;
|
||||
print A::outfile, A::right;
|
||||
return (T);
|
||||
}, config={
|
||||
|
||||
}]
|
||||
Type
|
||||
Input::EVENT_CHANGED
|
||||
Left
|
||||
[i=2]
|
||||
Right
|
||||
[s=<uninitialized>, ss=<uninitialized>]
|
||||
==========SERVERS============
|
||||
{
|
||||
[2] = [s=TEST, ss=TEST],
|
||||
[1] = [s=TEST, ss=<uninitialized>]
|
||||
}
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue