EventHandler: Deprecate Call(args, no_remote, ts), add Call(args)

The ts parameter was only added to Call() for the Broker::auto_publish()
functionality and propagating the network timestamp. By now, the auto-publish
functionality is deprecated, so it'd be good to cleanup that signature. There
won't be any need for no_remote in the future either.

Allow users to just use Call() instead.
This commit is contained in:
Arne Welzel 2025-03-26 18:11:25 +01:00
parent b535f03382
commit f7425b805d
2 changed files with 15 additions and 0 deletions

View file

@ -49,7 +49,11 @@ void Event::Dispatch(bool no_remote) {
reporter->BeginErrorHandler();
try {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
// Replace in v8.1 with handler->Call(&args).
handler->Call(&args, no_remote, ts);
#pragma GCC diagnostic pop
}
catch ( InterpreterException& e ) {

View file

@ -45,8 +45,19 @@ public:
auto_publish.erase(topic);
}
[[deprecated(
"Remove in v8.1. The no_remote and ts parameters are AutoPublish() specific and won't have an effect "
"in the future. Use Call(args)")]]
void Call(zeek::Args* vl, bool no_remote = false, double ts = run_state::network_time);
// Call the function associated with this handler.
void Call(zeek::Args* vl) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
Call(vl, false, run_state::network_time);
#pragma GCC diagnostic pop
}
// Returns true if there is at least one local or remote handler.
explicit operator bool() const;