mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Merge remote-tracking branch 'origin/topic/vern/zval'
* origin/topic/vern/zval: (42 commits) whitespace tweaks resolved some TODO comments remove unnecessary casts, and change necessary ones to use static_cast<> explain cmp_func default change functions for ZVal type management to static members fix some unsigned/signed integer warnings address lint concern about uninitialized variable Remove use of obsolete forward-declaration macros fix #include's that lack zeek/ prefixes explicitly populate holes created in vectors fixes for now-incorrect assumption that GetField always returns an existing ValPtr memory management for assignment to vector elements memory management for assignment to record fields destructor cleanup from ZAM_vector/ZAM_record fix #include's that lack zeek/ prefixes overlooked another way in which vector holes can be created initialize vector holes to the correct corresponding type explicitly populate holes created in vectors fix other instances of GetField().get() assuming long-lived ValPtr's fix for now-incorrect assumption that GetField always returns an existing ValPtr ...
This commit is contained in:
commit
f45df63cd0
100 changed files with 2376 additions and 1386 deletions
|
@ -1045,7 +1045,7 @@ threading::Value* Manager::ValToLogVal(Val* val, Type* ty)
|
|||
for ( bro_int_t i = 0; i < lval->val.vector_val.size; i++ )
|
||||
{
|
||||
lval->val.vector_val.vals[i] =
|
||||
ValToLogVal(vec->At(i).get(),
|
||||
ValToLogVal(vec->ValAt(i).get(),
|
||||
vec->GetType()->Yield().get());
|
||||
}
|
||||
|
||||
|
@ -1095,9 +1095,12 @@ threading::Value** Manager::RecordToFilterVals(Stream* stream, Filter* filter,
|
|||
// potentially be nested inside other records.
|
||||
list<int>& indices = filter->indices[i];
|
||||
|
||||
ValPtr val_ptr;
|
||||
|
||||
for ( list<int>::iterator j = indices.begin(); j != indices.end(); ++j )
|
||||
{
|
||||
val = val->AsRecordVal()->GetField(*j).get();
|
||||
val_ptr = val->AsRecordVal()->GetField(*j);
|
||||
val = val_ptr.get();
|
||||
|
||||
if ( ! val )
|
||||
{
|
||||
|
@ -1514,9 +1517,9 @@ std::string Manager::FormatRotationPath(EnumValPtr writer,
|
|||
auto ri = make_intrusive<RecordVal>(BifType::Record::Log::RotationFmtInfo);
|
||||
ri->Assign(0, std::move(writer));
|
||||
ri->Assign<StringVal>(1, path.size(), path.data());
|
||||
ri->Assign<TimeVal>(2, open);
|
||||
ri->Assign<TimeVal>(3, close);
|
||||
ri->Assign(4, val_mgr->Bool(terminating));
|
||||
ri->AssignTime(2, open);
|
||||
ri->AssignTime(3, close);
|
||||
ri->Assign(4, terminating);
|
||||
ri->Assign<FuncVal>(5, std::move(postprocessor));
|
||||
|
||||
std::string rval;
|
||||
|
@ -1605,11 +1608,11 @@ bool Manager::FinishedRotation(WriterFrontend* writer, const char* new_name, con
|
|||
|
||||
auto info = make_intrusive<RecordVal>(BifType::Record::Log::RotationInfo);
|
||||
info->Assign(0, {NewRef{}, winfo->type});
|
||||
info->Assign(1, make_intrusive<StringVal>(new_name));
|
||||
info->Assign(2, make_intrusive<StringVal>(winfo->writer->Info().path));
|
||||
info->Assign(3, make_intrusive<TimeVal>(open));
|
||||
info->Assign(4, make_intrusive<TimeVal>(close));
|
||||
info->Assign(5, val_mgr->Bool(terminating));
|
||||
info->Assign(1, new_name);
|
||||
info->Assign(2, winfo->writer->Info().path);
|
||||
info->AssignTime(3, open);
|
||||
info->AssignTime(4, close);
|
||||
info->Assign(5, terminating);
|
||||
|
||||
static auto default_ppf = id::find_func("Log::__default_rotation_postprocessor");
|
||||
|
||||
|
|
|
@ -818,11 +818,11 @@ void Ascii::RotateLeftoverLogs()
|
|||
|
||||
auto rot_info = make_intrusive<RecordVal>(rot_info_type);
|
||||
rot_info->Assign(0, writer_val);
|
||||
rot_info->Assign<StringVal>(1, rotation_path);
|
||||
rot_info->Assign<StringVal>(2, ll.Path());
|
||||
rot_info->Assign<TimeVal>(3, ll.open_time);
|
||||
rot_info->Assign<TimeVal>(4, ll.close_time);
|
||||
rot_info->Assign(5, val_mgr->False());
|
||||
rot_info->Assign(1, rotation_path);
|
||||
rot_info->Assign(2, ll.Path());
|
||||
rot_info->AssignTime(3, double(ll.open_time));
|
||||
rot_info->AssignTime(4, double(ll.close_time));
|
||||
rot_info->Assign(5, false);
|
||||
|
||||
if ( rename(ll.filename.data(), rotation_path.data()) != 0 )
|
||||
reporter->FatalError("Found leftover/unprocessed log '%s', but "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue