mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Port Zeek to latest Broker API
This commit is contained in:
parent
013070d1a9
commit
4ea1a593a9
33 changed files with 208 additions and 23 deletions
|
@ -275,7 +275,7 @@ void Manager::InitPostScript()
|
|||
|
||||
broker::broker_options options;
|
||||
options.disable_ssl = get_option("Broker::disable_ssl")->AsBool();
|
||||
options.forward = get_option("Broker::forward_messages")->AsBool();
|
||||
options.disable_forwarding = !get_option("Broker::forward_messages")->AsBool();
|
||||
options.use_real_time = use_real_time;
|
||||
|
||||
broker::configuration config{std::move(options)};
|
||||
|
@ -474,10 +474,6 @@ void Manager::Terminate()
|
|||
CloseStore(x);
|
||||
|
||||
FlushLogBuffers();
|
||||
|
||||
for ( auto& p : bstate->endpoint.peers() )
|
||||
if ( p.peer.network )
|
||||
bstate->endpoint.unpeer(p.peer.network->address, p.peer.network->port);
|
||||
}
|
||||
|
||||
bool Manager::Active()
|
||||
|
@ -554,7 +550,8 @@ void Manager::Peer(const string& addr, uint16_t port, double retry)
|
|||
if ( bstate->endpoint.is_shutdown() )
|
||||
return;
|
||||
|
||||
DBG_LOG(DBG_BROKER, "Starting to peer with %s:%" PRIu16, addr.c_str(), port);
|
||||
DBG_LOG(DBG_BROKER, "Starting to peer with %s:%" PRIu16 " (retry: %fs)",
|
||||
addr.c_str(), port, retry);
|
||||
|
||||
auto e = getenv("ZEEK_DEFAULT_CONNECT_RETRY");
|
||||
|
||||
|
@ -1657,6 +1654,14 @@ void Manager::ProcessStatus(broker::status_view stat)
|
|||
event = ::Broker::peer_lost;
|
||||
break;
|
||||
|
||||
case broker::sc::endpoint_discovered:
|
||||
event = ::Broker::endpoint_discovered;
|
||||
break;
|
||||
|
||||
case broker::sc::endpoint_unreachable:
|
||||
event = ::Broker::endpoint_unreachable;
|
||||
break;
|
||||
|
||||
default:
|
||||
reporter->Warning("Unhandled Broker status: %s", to_string(stat).data());
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue