From f7425b805d5232a3acf998587916e707e5f5bd19 Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 26 Mar 2025 18:11:25 +0100 Subject: [PATCH] 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. --- src/Event.cc | 4 ++++ src/EventHandler.h | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Event.cc b/src/Event.cc index 4525118de6..6d449684e5 100644 --- a/src/Event.cc +++ b/src/Event.cc @@ -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 ) { diff --git a/src/EventHandler.h b/src/EventHandler.h index cb612eb825..5f8472b2ce 100644 --- a/src/EventHandler.h +++ b/src/EventHandler.h @@ -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;