diff --git a/src/RunState.cc b/src/RunState.cc index 5111ec350f..14af43dba3 100644 --- a/src/RunState.cc +++ b/src/RunState.cc @@ -106,7 +106,7 @@ RETSIGTYPE watchdog(int /* signo */) { } get_final_stats(); - finish_run(0); + util::detail::set_processing_status("TERMINATING", "watchdog"); reporter->FatalErrorWithCore("**watchdog timer expired, t = %d.%06d, start = %d.%06d, dispatched = %d", int_ct, frac_ct, int_pst, frac_pst, current_dispatched); @@ -340,9 +340,7 @@ void run_loop() { } } - // Get the final statistics now, and not when finish_run() is - // called, since that might happen quite a bit in the future - // due to expiring pending timers, and we don't want to ding + // Get the final statistics now, as we don't want to ding // for any packets dropped beyond this point. get_final_stats(); } @@ -375,29 +373,6 @@ void get_final_stats() { } } -void finish_run(int drain_events) { - util::detail::set_processing_status("TERMINATING", "finish_run"); - - if ( drain_events ) { - if ( session_mgr ) - session_mgr->Drain(); - - event_mgr.Drain(); - - if ( session_mgr ) - session_mgr->Clear(); - } - -#ifdef DEBUG - extern int reassem_seen_bytes, reassem_copied_bytes; - // DEBUG_MSG("Reassembly (TCP and IP/Frag): %d bytes seen, %d bytes copied\n", - // reassem_seen_bytes, reassem_copied_bytes); - - extern int num_packets_held, num_packets_cleaned; - // DEBUG_MSG("packets clean up: %d/%d\n", num_packets_cleaned, num_packets_held); -#endif -} - void delete_run() { util::detail::set_processing_status("TERMINATING", "delete_run"); diff --git a/src/RunState.h b/src/RunState.h index 1015aa888a..451b9cb63b 100644 --- a/src/RunState.h +++ b/src/RunState.h @@ -26,7 +26,6 @@ extern void init_run(const std::optional& interfaces, const std::op const std::optional& pcap_output_file, bool do_watchdog); extern void run_loop(); extern void get_final_stats(); -extern void finish_run(int drain_events); extern void delete_run(); // Reclaim all memory, etc. extern void update_network_time(double new_network_time); extern void dispatch_packet(zeek::Packet* pkt, zeek::iosource::PktSrc* pkt_src); diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index ad9a579243..3851e7d4e6 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -322,7 +322,9 @@ static void done_with_network() { event_mgr.Drain(); event_mgr.Drain(); - run_state::detail::finish_run(1); + session_mgr->Drain(); + event_mgr.Drain(); + session_mgr->Clear(); #ifdef USE_PERFTOOLS_DEBUG