Minor formatting/style changes in merge.
* 'refactor_obj' of https://github.com/MaxKellermann/zeek:
Val: use C++ initializers
Val: add BroValUnion constructors
Val: reduce duplicate code by using delegating constructors
Val: remove unused default constructors and `friend` declarations
Val: remove the unnecessary BroValUnion typedef
Type: remove unnecessary enum typedefs
Type: use C++ initializers
Type: move code from BroType::BroType() to constexpr functions
Type: remove useless BroType destructor
Obj: disallow copying BroObj
Obj: use C++ initializers
Obj: make `no_location` constexpr
Minor formatting change in merge so [[noreturn]] is consistently
on same line as function declarations.
* 'noreturn' of https://github.com/MaxKellermann/zeek:
threading/MsgThread: add [[noreturn]] to InternalError()
Flare: add [[noreturn]] to bad_pipe_op()
Obj: add [[noreturn]] attributes to Internal(), bad_ref()
Reporter: add [[noreturn]] attribute to several methods
Minor whitespace fixes during merge.
* 'smart_ptr' of https://github.com/MaxKellermann/zeek:
OpaqueVal: remove misplaced `virtual` keywords
CompHash: use class IntrusivePtr for the `type` field
IntrusivePtr: replace the "add_ref" parameter with tag structs
IntrusivePtr: remove reset(), nobody uses it
IntrusivePtr: remove ordering operators
IntrusivePtr: rename detach() to release()
IntrusivePtr: move nullptr initializer to field declaration
Updated the Ref() to happen inline with Assign() call for clarity.
* 'expr_missing_ref' of https://github.com/MaxKellermann/zeek:
Expr: add missing reference in AssignExpr::InitVal()
The merge commit fixes reference counting issues introduced with the
changes to ListExpr::Assign() and IndexExpr::Assign(), but then also
several other pre-existing reference counting confusions in other
Assign() implementations/calls, some which were now directly observable
via new crashing behavior, others just from a cursory code audit.
* 'memleaks' of https://github.com/MaxKellermann/zeek:
input/Manager: fix memory leak in UnrollRecordType()
OpaqueVal: fix two memory leaks in BloomFilterVal::Merge()
DbgBreakpoint: fix memory leak
DebugCmds: fix memory leak
scan.l: fix crash bug in do_atif()
Expr: fix memory leak in RecordConstructorExpr::InitVal()
Expr: fix memory leaks in AssignExpr::EvalIntoAggregate()
Expr: fix memory leaks in CondExpr::Eval()
Expr: fix several memory leaks in BoolExpr::Eval()
Expr: fix various memory leaks in Assign()
Expr: fix memory leaks in BinaryExpr::Eval()
analyzer/protocol/http: fix potential memory leak
* MaxKellermann/includes:
broker: include cleanup
file_analysis: include cleanup
file_analysis/Analyzer: eliminate duplicate constructor
probabilistic/Topk: include cleanup
digest: eliminate the "Reporter.h" include
Val: eliminate the "RE.h" include
Val: eliminate the "BroString.h" include
Val: eliminate the "CompHash.h" include
Val: forward-declare class PDict, reduce includes
Val: eliminate the "Scope.h" include
* origin/topic/timw/dict-unit-tests:
Reset the number of entries in a dict when calling Clear()
Code cleanup in Dict.h
Add unit testing for the public Dictionary API
* origin/topic/timw/clang-tidy:
fixup! Use string_view for a couple of Dbg methods
Add a couple of missing #includes that clang-tidy complains about (clang-diagnostic-error)
Fix missing namespace that was causing a build error
Remove unnecessary const from return value (readability-const-return-type)
Give real variable names to SegmentProfiler objects when defining them (bugprone-unused-raii)
Mark a few clang-tidy findings as false-positive
Use std::move in a few places instead of copying a pass-by-value argument (performance-unnecessary-value-param)
Use const-references in lots of places (preformance-unnecessary-value-param)
Use string_view for a couple of Dbg methods
Use const references over copying variables (performance-unnecessary-copy-initialization, performance-for-range-copy)
Use single-character version of string find() (performance-faster-string-find)
Move constructors/operators should be marked noexcept to avoid the compiler picking the copy constructor instead (performance-noexcept-move-constructor)
A race condition could cause unstable output: if the thread reading the
file is fast, often you see both "pred" functions execute and then both
"line" events execute with both entries already in the table, but if the
thread reading the file is slow, you see pred, event, pred, event, with
only one entry available in the first event.
The order in which &expire_func's get called isn't well-defined, so
separate the output from either to ensure diffs against the Baseline are
always consistent.
* max/optimize:
plugin/Manager: migrate to std::string_view
util: optimize the normal_path() common case
util: pass string_view to without_bropath_component()
module_util: make GLOBAL_MODULE_NAME constexpr
Scope: convert Scope::Lookup() and others to template
Scope: Vars() returns const reference
Anon: remove unnecessary {map,vector}::clear() calls
Dict: make the destructor non-virtual
Obj: make the Location constructors `constexpr`
Obj: remove unused fields Location::{timestamp,text}
Obj: remove Location::delete_data, nobody ever sets it
Obj: make the Location destructor non-virtual
* origin/topic/johanna/table-on-change:
&on_change: Address feedback of Jon.
&on_change: incooperate feedback of Jon.
&on_change wrapup: documentation, tests, whitespacing
Table expiry now raises &on_change handlers
Prevent recursion of &on_change handlers.
Make bro_broker::val_to_data take a const Val* instead of a Val
&on_change: add insertion/change notifications.
&on_change working for removals from tables.
Change signature of &on_change handler
Beginning implementation of &on_change for tables.
threading::Manager is currently never deleted, but if that ever changes,
deleting the stored HeartbeatTimer pointer would be a double-free
since TimerMgr owns it.
- Also removed the setting of BinPAC_ROOT_DIR in the configure
script's --with-binpac= option as that breaks the cross-compilation
use-case
* 'master' of https://github.com/ffontaine/zeek:
CMakeLists.txt: fix cross-compilation with binpac
* origin/topic/timw/ioloop-followup:
Increase timeout value for live interfaces without file descriptors
Use ranged-for loops in a few places in iosource Manager
Change order of includes in iosource Manager, fixes build on FreeBSD 11
- Minor changes in merge: extended unit test, prefer emplace_back(),
remove unused "found" count in new function
* 'optimize_normalize_path' of https://github.com/MaxKellermann/zeek:
util: add a tokenize_string() overload which returns string_views
util: store std::string_view in "final_components" vector
util: use "auto" in normalize_path()
util: reserve space in normalize_path()
util: skip "." completely in normalize_path()
util: pass std::string_view to normalize_path()
util: pass std::string_view to tokenize_string()
util: don't modify the input string in tokenize_string()
* origin/topic/timw/264-alternative:
Add better error messaging when RegisterFd/UnregisterFd fail
Update Supervisor code for the new IOSource API
Show percentage of packets dropped in the final process output
Update NEWS and docs submodule
Remove concept of multiple timer managers
Test changes caused by minor order-of-operation changes related to the new loop architecture
Have terminate_processing() raise SIGTERM instead of calling the signal handler directly
PktSrc iosource changes to match the new IOSource API
Broker manager changes to match the new IOSource API and loop architecture
DNS_Mgr changes to match the new IOSource API and loop architecture
Threading changes for the new loop architecture
Add Trigger manager for managing triggers created by things like 'when' statements
Make TimerMgr an IOSource
Modify IOSource Manager to implement new loop architecture
Minor amount of code cleanup in Pcap IO source
IOSource API changes for new loop architecture
Type and variable usage cleanup in Net.h
Remove #include of some iosource files from Net.h
Only allow a single trace file (-r) or interface (-i) option on the command-line
Remove CQ_TimerMgr in favor of PQ_TimerMgr
During merge I split the test for bro_init/bro_done/bro_script_loaded
event errors into individual tests since the other testing of the zeek
versions of those events seemed fine to otherwise keep.
* origin/topic/robin/631-deprecation-v2:
Update NEWS for naming changes.
Small cleanup and updating submodules.
Remove test for legacy plugin.
Remove legancy symlinks in aux/.
Add warnings when loading scripts ending in ".bro", or using legacy environment variables.
Fix missing rename.
No longer symlink local.zeek to local.bro.
Update notice user agent.
Remove old_comm_usage_is_ok.
Remove bro-config.h.in and bro-path-dev.in.
Change Bro wrapper script to now abort when old executable names are still used.
Remove APIs that were explicitly deprecated to be removed in 3.1.