Merge remote-tracking branch 'origin/topic/arne.welzel/fix-poll-interval-is-live'

* origin/topic/arne.welzel/fix-poll-interval-is-live:
  iosource/Manager: Fix poll_interval updating using not-yet valid IsLive()
This commit is contained in:
Tim Wojtulewicz 2023-04-12 13:23:29 -07:00
commit 6ac72a31bf
4 changed files with 37 additions and 3 deletions

View file

@ -402,12 +402,16 @@ void Manager::Register(PktSrc* src)
{
pkt_src = src;
Register(src, false);
// Once we know if the source is live or not, adapt the
// poll_interval accordingly.
//
// Note that src->IsLive() is only valid after calling Register().
if ( src->IsLive() )
poll_interval = BifConst::io_poll_interval_live;
else if ( run_state::pseudo_realtime )
poll_interval = 1;
Register(src, false);
}
static std::pair<std::string, std::string> split_prefix(std::string path)