RunState: Drop broker_mgr->Active() usage

...and deprecate it. The communication_enabled flag doesn't really
make a difference in how the IO loop works.
This commit is contained in:
Arne Welzel 2024-08-28 18:41:48 +02:00
parent 79ebce6e3c
commit a9e4a45310
2 changed files with 3 additions and 7 deletions

View file

@ -31,7 +31,6 @@ extern "C" {
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/Scope.h" #include "zeek/Scope.h"
#include "zeek/Timer.h" #include "zeek/Timer.h"
#include "zeek/broker/Manager.h"
#include "zeek/iosource/Manager.h" #include "zeek/iosource/Manager.h"
#include "zeek/iosource/PktDumper.h" #include "zeek/iosource/PktDumper.h"
#include "zeek/iosource/PktSrc.h" #include "zeek/iosource/PktSrc.h"
@ -275,8 +274,6 @@ void run_loop() {
} }
#endif #endif
current_iosrc = nullptr; current_iosrc = nullptr;
auto communication_enabled = broker_mgr->Active();
if ( ! ready.empty() ) { if ( ! ready.empty() ) {
for ( const auto& src : ready ) { for ( const auto& src : ready ) {
auto* iosrc = src.src; auto* iosrc = src.src;
@ -289,8 +286,7 @@ void run_loop() {
iosrc->Process(); iosrc->Process();
} }
} }
else if ( (have_pending_timers || communication_enabled || BifConst::exit_only_after_terminate) && else if ( (have_pending_timers || BifConst::exit_only_after_terminate) && pseudo_realtime == 0.0 ) {
! pseudo_realtime ) {
// Take advantage of the lull to get up to // Take advantage of the lull to get up to
// date on timers and events. Because we only // date on timers and events. Because we only
// have timers as sources, going to sleep here // have timers as sources, going to sleep here
@ -330,7 +326,7 @@ void run_loop() {
// Terminate if we're running pseudo_realtime and // Terminate if we're running pseudo_realtime and
// the interface has been closed. // the interface has been closed.
if ( pseudo_realtime && communication_enabled ) { if ( pseudo_realtime != 0.0 ) {
iosource::PktSrc* ps = iosource_mgr->GetPktSrc(); iosource::PktSrc* ps = iosource_mgr->GetPktSrc();
if ( ps && ! ps->IsOpen() ) if ( ps && ! ps->IsOpen() )
iosource_mgr->Terminate(); iosource_mgr->Terminate();

View file

@ -109,7 +109,7 @@ public:
/** /**
* Returns true if any Broker communication is currently active. * Returns true if any Broker communication is currently active.
*/ */
bool Active(); [[deprecated("Remove with v8.1 - unused")]] bool Active();
/** /**
* Advances time. Broker data store expiration is driven by this * Advances time. Broker data store expiration is driven by this