mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Internal refactoring to provide injection points for remotely received
log records. Also added some additional type-safety check to later make sure that what a peer sends is actually of the expected format.
This commit is contained in:
parent
e6edc52d54
commit
ba2c6f6139
4 changed files with 142 additions and 75 deletions
|
@ -33,8 +33,17 @@ bool LogWriter::Init(string arg_path, int arg_num_fields, LogField** arg_fields)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LogWriter::Write(LogVal** vals)
|
||||
bool LogWriter::Write(int arg_num_fields, LogVal** vals)
|
||||
{
|
||||
// Double-check that the arguments match. If we get this from remote,
|
||||
// something might be mixed up.
|
||||
if ( num_fields != arg_num_fields )
|
||||
return false;
|
||||
|
||||
for ( int i = 0; i < num_fields; ++i )
|
||||
if ( vals[i]->type != fields[i]->type )
|
||||
return false;
|
||||
|
||||
bool result = DoWrite(num_fields, fields, vals);
|
||||
DeleteVals(vals);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue