mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +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
|
@ -79,6 +79,12 @@ public:
|
|||
void PopLocation()
|
||||
{ locations.pop_back(); }
|
||||
|
||||
// Signals that we're entering processing an error handler event.
|
||||
void BeginErrorHandler() { ++in_error_handler; }
|
||||
|
||||
// Signals that we're done processing an error handler event.
|
||||
void EndErrorHandler() { --in_error_handler; }
|
||||
|
||||
private:
|
||||
void DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Connection* conn, val_list* addl, bool location, bool time, const char* fmt, va_list ap);
|
||||
|
||||
|
@ -87,6 +93,7 @@ private:
|
|||
|
||||
int errors;
|
||||
bool via_events;
|
||||
int in_error_handler;
|
||||
|
||||
std::list<std::pair<const Location*, const Location*> > locations;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue