Deprecate global Val pointers in NetVar.h

All of these have fairly niche uses, so better maintained as
lookup/static closer to the usage site.
This commit is contained in:
Jon Siwek 2020-05-12 00:01:40 -07:00
parent c0986f0739
commit d34b24e776
13 changed files with 83 additions and 49 deletions

View file

@ -1193,8 +1193,8 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, WriterBacken
// Still need to set the WriterInfo's rotation parameters, which we
// computed above.
const char* base_time = log_rotate_base_time ?
log_rotate_base_time->AsString()->CheckString() : nullptr;
static auto log_rotate_base_time = zeek::lookup_val<StringVal>("log_rotate_base_time");
static auto base_time = log_rotate_base_time->AsString()->CheckString();
winfo->info->rotation_interval = winfo->interval;
winfo->info->rotation_base = parse_rotate_base_time(base_time);
@ -1453,8 +1453,8 @@ void Manager::InstallRotationTimer(WriterInfo* winfo)
if ( ! winfo->open_time )
winfo->open_time = network_time;
const char* base_time = log_rotate_base_time ?
log_rotate_base_time->AsString()->CheckString() : nullptr;
static auto log_rotate_base_time = zeek::lookup_val<StringVal>("log_rotate_base_time");
static auto base_time = log_rotate_base_time->AsString()->CheckString();
double base = parse_rotate_base_time(base_time);
double delta_t =