mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
A bunch of more changes for the raw reader
* send end_of_data event for all kind of streams * send process_finished event containing exit code of child process for executed programs * move raw-tests to separate directory * expose name of input stream to readers * better handling of some error cases in raw reader * new force_kill option for raw reader which SIGKILLs progesses on exit The ordering of events how they arrive in the main loop is a bit peculiar at the moment. The process_finished event arrives in scriptland before all of the other events, even though it should be sent last. I have not yet fully figured that out.
This commit is contained in:
parent
f1c91f02ce
commit
8875953751
21 changed files with 166 additions and 174 deletions
|
@ -299,6 +299,7 @@ bool Manager::CreateStream(Stream* info, RecordVal* description)
|
|||
|
||||
ReaderBackend::ReaderInfo* rinfo = new ReaderBackend::ReaderInfo();
|
||||
rinfo->source = copy_string(source.c_str());
|
||||
rinfo->name = copy_string(name.c_str());
|
||||
|
||||
EnumVal* mode = description->LookupWithDefault(rtype->FieldOffset("mode"))->AsEnumVal();
|
||||
switch ( mode->InternalInt() )
|
||||
|
@ -1175,6 +1176,9 @@ void Manager::EndCurrentSend(ReaderFrontend* reader)
|
|||
|
||||
if ( i->stream_type == EVENT_STREAM )
|
||||
{
|
||||
#ifdef DEBUG
|
||||
DBG_LOG(DBG_INPUT, "%s is event, sending end of data", i->name.c_str());
|
||||
#endif
|
||||
// just signal the end of the data source
|
||||
SendEndOfData(i);
|
||||
return;
|
||||
|
@ -1281,6 +1285,10 @@ void Manager::SendEndOfData(ReaderFrontend* reader)
|
|||
|
||||
void Manager::SendEndOfData(const Stream *i)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
DBG_LOG(DBG_INPUT, "SendEndOfData for stream %s",
|
||||
i->name.c_str());
|
||||
#endif
|
||||
SendEvent(end_of_data, 2, new StringVal(i->name.c_str()), new StringVal(i->info->source));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue