mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Avoiding infinite loops when an error message handlers triggers errors
itself. If an error is triggered inside one of the reporter_* handlers, the message about that will now fall back to stderr.
This commit is contained in:
parent
66e2c3b623
commit
fb6a8cec19
16 changed files with 94 additions and 11 deletions
|
@ -39,6 +39,11 @@ public:
|
|||
void SetUsed() { used = true; }
|
||||
bool Used() { return used; }
|
||||
|
||||
// Handlers marked as error handlers will not be called recursively to
|
||||
// avoid infinite loops if they trigger a similar error themselves.
|
||||
void SetErrorHandler() { error_handler = true; }
|
||||
bool ErrorHandler() { return error_handler; }
|
||||
|
||||
const char* Group() { return group; }
|
||||
void SetGroup(const char* arg_group)
|
||||
{ group = copy_string(arg_group); }
|
||||
|
@ -57,6 +62,7 @@ private:
|
|||
FuncType* type;
|
||||
bool used; // this handler is indeed used somewhere
|
||||
bool enabled;
|
||||
bool error_handler; // this handler reports error messages.
|
||||
|
||||
declare(List, SourceID);
|
||||
typedef List(SourceID) receiver_list;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue