mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Change Input::update_finished lookup to happen at init time.
Also going through the internal_handler() function will set the event as "used" (i.e. it's marked as being raised somewhere) and fixes the core.check-unused-event-handlers test failure (addresses #823).
This commit is contained in:
parent
60875adfc5
commit
eeb1609768
2 changed files with 4 additions and 5 deletions
|
@ -194,6 +194,7 @@ Manager::TableStream::~TableStream()
|
||||||
|
|
||||||
Manager::Manager()
|
Manager::Manager()
|
||||||
{
|
{
|
||||||
|
update_finished = internal_handler("Input::update_finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager::~Manager()
|
Manager::~Manager()
|
||||||
|
@ -1199,11 +1200,7 @@ void Manager::EndCurrentSend(ReaderFrontend* reader)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Send event that the current update is indeed finished.
|
// Send event that the current update is indeed finished.
|
||||||
EventHandler* handler = event_registry->Lookup("Input::update_finished");
|
SendEvent(update_finished, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str()));
|
||||||
if ( handler == 0 )
|
|
||||||
reporter->InternalError("Input::update_finished not found!");
|
|
||||||
|
|
||||||
SendEvent(handler, 2, new StringVal(i->name.c_str()), new StringVal(i->source.c_str()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::Put(ReaderFrontend* reader, Value* *vals)
|
void Manager::Put(ReaderFrontend* reader, Value* *vals)
|
||||||
|
|
|
@ -184,6 +184,8 @@ private:
|
||||||
enum StreamType { TABLE_STREAM, EVENT_STREAM };
|
enum StreamType { TABLE_STREAM, EVENT_STREAM };
|
||||||
|
|
||||||
map<ReaderFrontend*, Stream*> readers;
|
map<ReaderFrontend*, Stream*> readers;
|
||||||
|
|
||||||
|
EventHandlerPtr update_finished;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue