mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Allow offline packet sources to register FDs.
This commit is contained in:
parent
8cf9e5b374
commit
99f16282c0
2 changed files with 8 additions and 13 deletions
|
@ -83,17 +83,11 @@ void PktSrc::Opened(const Properties& arg_props)
|
|||
}
|
||||
|
||||
if ( props.is_live )
|
||||
{
|
||||
Info(util::fmt("listening on %s\n", props.path.c_str()));
|
||||
|
||||
// We only register the file descriptor if we're in live
|
||||
// mode because libpcap's file descriptor for trace files
|
||||
// isn't a reliable way to know whether we actually have
|
||||
// data to read.
|
||||
if ( props.selectable_fd != -1 )
|
||||
if ( ! iosource_mgr->RegisterFd(props.selectable_fd, this) )
|
||||
reporter->FatalError("Failed to register pktsrc fd with iosource_mgr");
|
||||
}
|
||||
if ( props.selectable_fd != -1 )
|
||||
if ( ! iosource_mgr->RegisterFd(props.selectable_fd, this) )
|
||||
reporter->FatalError("Failed to register pktsrc fd with iosource_mgr");
|
||||
|
||||
DBG_LOG(DBG_PKTIO, "Opened source %s", props.path.c_str());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue