mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
prevent several remove operations for the same thread to be queued and output errors in that case.
This commit is contained in:
parent
315948dbc8
commit
872ad195f7
1 changed files with 9 additions and 0 deletions
|
@ -33,6 +33,7 @@ class Manager::Filter {
|
|||
public:
|
||||
string name;
|
||||
string source;
|
||||
bool removed;
|
||||
|
||||
int mode;
|
||||
|
||||
|
@ -51,6 +52,7 @@ Manager::Filter::Filter() {
|
|||
type = 0;
|
||||
reader = 0;
|
||||
description = 0;
|
||||
removed = false;
|
||||
}
|
||||
|
||||
Manager::Filter::~Filter() {
|
||||
|
@ -597,6 +599,13 @@ bool Manager::RemoveStream(const string &name) {
|
|||
return false; // not found
|
||||
}
|
||||
|
||||
if ( i->removed ) {
|
||||
reporter->Error("Stream %s is already queued for removal. Ignoring", name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
i->removed = true;
|
||||
|
||||
i->reader->Finish();
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue