mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/bit-1408'
BIT-1408 #merged * origin/topic/jsiwek/bit-1408: BIT-1408: improve I/O loop and Broker IOSource.
This commit is contained in:
commit
476a5dbc34
6 changed files with 34 additions and 18 deletions
|
@ -118,9 +118,6 @@ IOSource* Manager::FindSoonest(double* ts)
|
|||
|
||||
src->Clear();
|
||||
src->src->GetFds(&src->fd_read, &src->fd_write, &src->fd_except);
|
||||
if ( src->fd_read.Empty() ) src->fd_read.Insert(0);
|
||||
if ( src->fd_write.Empty() ) src->fd_write.Insert(0);
|
||||
if ( src->fd_except.Empty() ) src->fd_except.Insert(0);
|
||||
src->SetFds(&fd_read, &fd_write, &fd_except, &maxx);
|
||||
}
|
||||
|
||||
|
|
|
@ -240,6 +240,18 @@ void PktSrc::GetFds(iosource::FD_Set* read, iosource::FD_Set* write,
|
|||
|
||||
if ( IsOpen() && props.selectable_fd >= 0 )
|
||||
read->Insert(props.selectable_fd);
|
||||
|
||||
// TODO: This seems like a hack that should be removed, but doing so
|
||||
// causes the main run loop to spin more frequently and increase cpu usage.
|
||||
// See also commit 9cd85be308.
|
||||
if ( read->Empty() )
|
||||
read->Insert(0);
|
||||
|
||||
if ( write->Empty() )
|
||||
write->Insert(0);
|
||||
|
||||
if ( except->Empty() )
|
||||
except->Insert(0);
|
||||
}
|
||||
|
||||
double PktSrc::NextTimestamp(double* local_network_time)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue