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:
|
public:
|
||||||
string name;
|
string name;
|
||||||
string source;
|
string source;
|
||||||
|
bool removed;
|
||||||
|
|
||||||
int mode;
|
int mode;
|
||||||
|
|
||||||
|
@ -51,6 +52,7 @@ Manager::Filter::Filter() {
|
||||||
type = 0;
|
type = 0;
|
||||||
reader = 0;
|
reader = 0;
|
||||||
description = 0;
|
description = 0;
|
||||||
|
removed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager::Filter::~Filter() {
|
Manager::Filter::~Filter() {
|
||||||
|
@ -597,6 +599,13 @@ bool Manager::RemoveStream(const string &name) {
|
||||||
return false; // not found
|
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();
|
i->reader->Finish();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue