automatically delete disabled input streams

This commit is contained in:
Bernhard Amann 2012-06-07 14:12:42 -07:00
parent 18f07d3a46
commit 852de4700c
4 changed files with 39 additions and 11 deletions

View file

@ -689,16 +689,14 @@ bool Manager::IsCompatibleType(BroType* t, bool atomic_only)
}
bool Manager::RemoveStream(const string &name)
bool Manager::RemoveStream(Stream *i)
{
Stream *i = FindStream(name);
if ( i == 0 )
return false; // not found
if ( i->removed )
{
reporter->Error("Stream %s is already queued for removal. Ignoring remove.", name.c_str());
reporter->Error("Stream %s is already queued for removal. Ignoring remove.", i->name.c_str());
return false;
}
@ -708,12 +706,24 @@ bool Manager::RemoveStream(const string &name)
#ifdef DEBUG
DBG_LOG(DBG_INPUT, "Successfully queued removal of stream %s",
name.c_str());
i->name.c_str());
#endif
return true;
}
bool Manager::RemoveStream(ReaderFrontend* frontend)
{
return RemoveStream(FindStream(frontend));
}
bool Manager::RemoveStream(const string &name)
{
return RemoveStream(FindStream(name));
}
bool Manager::RemoveStreamContinuation(ReaderFrontend* reader)
{
Stream *i = FindStream(reader);