mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Review usage of Reporter::InternalError, addresses BIT-1045.
Replaced some with InternalWarning or InternalAnalyzerError, the later being a new method which signals the analyzer to not process further input. Some usages I just removed if they didn't make sense or clearly couldn't happen. Also did some minor refactors of related code while reviewing/exploring ways to get rid of InternalError usages. Also, for TCP content file write failures there's a new event: "contents_file_write_failure".
This commit is contained in:
parent
6734260136
commit
b828a6ddc7
51 changed files with 532 additions and 267 deletions
|
@ -137,11 +137,27 @@ void Reporter::InternalError(const char* fmt, ...)
|
|||
abort();
|
||||
}
|
||||
|
||||
void Reporter::InternalAnalyzerError(analyzer::Analyzer* a, const char* fmt,
|
||||
...)
|
||||
{
|
||||
if ( a )
|
||||
a->SetSkip(true);
|
||||
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
// Always log to stderr.
|
||||
// TODO: would be nice to also log a call stack.
|
||||
DoLog("analyzer error", reporter_error, stderr, 0, 0, true, true, 0, fmt,
|
||||
ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void Reporter::InternalWarning(const char* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
FILE* out = warnings_to_stderr ? stderr : 0;
|
||||
// TODO: would be nice to also log a call stack.
|
||||
DoLog("internal warning", reporter_warning, out, 0, 0, true, true, 0, fmt,
|
||||
ap);
|
||||
va_end(ap);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue