mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
broker and cluster: Wire up HookPublishEvent
This commit is contained in:
parent
621fd2ab39
commit
53236a184a
2 changed files with 12 additions and 0 deletions
|
@ -38,6 +38,8 @@
|
|||
#include "zeek/iosource/Manager.h"
|
||||
#include "zeek/logging/Manager.h"
|
||||
#include "zeek/logging/Types.h"
|
||||
#include "zeek/plugin/Manager.h"
|
||||
#include "zeek/plugin/Plugin.h"
|
||||
#include "zeek/telemetry/Manager.h"
|
||||
#include "zeek/util.h"
|
||||
|
||||
|
@ -825,6 +827,10 @@ std::vector<broker::peer_info> Manager::Peers() const {
|
|||
std::string Manager::NodeID() const { return to_string(bstate->endpoint.node_id()); }
|
||||
|
||||
bool Manager::DoPublishEvent(const std::string& topic, cluster::detail::Event& event) {
|
||||
bool do_publish = PLUGIN_HOOK_WITH_RESULT(HOOK_PUBLISH_EVENT, HookPublishEvent(*this, topic, event), true);
|
||||
if ( ! do_publish )
|
||||
return true;
|
||||
|
||||
auto maybe_ev = zeek::cluster::detail::to_broker_event(event);
|
||||
if ( ! maybe_ev )
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue