mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fixing a number of reporter calls.
This commit is contained in:
parent
9af6c183d2
commit
a08c478079
9 changed files with 22 additions and 22 deletions
|
@ -1392,7 +1392,7 @@ const forward_remote_state_changes = F &redef;
|
||||||
const PEER_ID_NONE = 0;
|
const PEER_ID_NONE = 0;
|
||||||
|
|
||||||
## Whether to use the connection tracker.
|
## Whether to use the connection tracker.
|
||||||
const use_connection_compressor = T &redef;
|
const use_connection_compressor = F &redef;
|
||||||
|
|
||||||
## Whether compressor should handle refused connections itself.
|
## Whether compressor should handle refused connections itself.
|
||||||
const cc_handle_resets = F &redef;
|
const cc_handle_resets = F &redef;
|
||||||
|
|
12
src/Debug.cc
12
src/Debug.cc
|
@ -54,7 +54,7 @@ DebuggerState::~DebuggerState()
|
||||||
bool StmtLocMapping::StartsAfter(const StmtLocMapping* m2)
|
bool StmtLocMapping::StartsAfter(const StmtLocMapping* m2)
|
||||||
{
|
{
|
||||||
if ( ! m2 )
|
if ( ! m2 )
|
||||||
reporter->InternalError("Assertion failed: %s", "m2 != 0");
|
reporter->InternalError("Assertion failed: m2 != 0");
|
||||||
|
|
||||||
return loc.first_line > m2->loc.first_line ||
|
return loc.first_line > m2->loc.first_line ||
|
||||||
(loc.first_line == m2->loc.first_line &&
|
(loc.first_line == m2->loc.first_line &&
|
||||||
|
@ -603,7 +603,7 @@ int dbg_execute_command(const char* cmd)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ( int(cmd_code) >= num_debug_cmds() )
|
if ( int(cmd_code) >= num_debug_cmds() )
|
||||||
reporter->InternalError("Assertion failed: %s", "int(cmd_code) < num_debug_cmds()");
|
reporter->InternalError("Assertion failed: int(cmd_code) < num_debug_cmds()");
|
||||||
|
|
||||||
// Dispatch to the op-specific handler (with args).
|
// Dispatch to the op-specific handler (with args).
|
||||||
int retcode = dbg_dispatch_cmd(cmd_code, arguments);
|
int retcode = dbg_dispatch_cmd(cmd_code, arguments);
|
||||||
|
@ -612,7 +612,7 @@ int dbg_execute_command(const char* cmd)
|
||||||
|
|
||||||
const DebugCmdInfo* info = get_debug_cmd_info(cmd_code);
|
const DebugCmdInfo* info = get_debug_cmd_info(cmd_code);
|
||||||
if ( ! info )
|
if ( ! info )
|
||||||
reporter->InternalError("Assertion failed: %s", "info");
|
reporter->InternalError("Assertion failed: info");
|
||||||
|
|
||||||
if ( ! info )
|
if ( ! info )
|
||||||
return -2; // ### yuck, why -2?
|
return -2; // ### yuck, why -2?
|
||||||
|
@ -766,7 +766,7 @@ int dbg_handle_debug_input()
|
||||||
|
|
||||||
const Stmt* stmt = curr_frame->GetNextStmt();
|
const Stmt* stmt = curr_frame->GetNextStmt();
|
||||||
if ( ! stmt )
|
if ( ! stmt )
|
||||||
reporter->InternalError("Assertion failed: %s", "stmt != 0");
|
reporter->InternalError("Assertion failed: stmt != 0");
|
||||||
|
|
||||||
const Location loc = *stmt->GetLocationInfo();
|
const Location loc = *stmt->GetLocationInfo();
|
||||||
|
|
||||||
|
@ -943,11 +943,11 @@ Val* dbg_eval_expr(const char* expr)
|
||||||
(g_frame_stack.size() - 1) - g_debugger_state.curr_frame_idx;
|
(g_frame_stack.size() - 1) - g_debugger_state.curr_frame_idx;
|
||||||
|
|
||||||
if ( ! (frame_idx >= 0 && (unsigned) frame_idx < g_frame_stack.size()) )
|
if ( ! (frame_idx >= 0 && (unsigned) frame_idx < g_frame_stack.size()) )
|
||||||
reporter->InternalError("Assertion failed: %s", "frame_idx >= 0 && (unsigned) frame_idx < g_frame_stack.size()");
|
reporter->InternalError("Assertion failed: frame_idx >= 0 && (unsigned) frame_idx < g_frame_stack.size()");
|
||||||
|
|
||||||
Frame* frame = g_frame_stack[frame_idx];
|
Frame* frame = g_frame_stack[frame_idx];
|
||||||
if ( ! (frame) )
|
if ( ! (frame) )
|
||||||
reporter->InternalError("Assertion failed: %s", "frame");
|
reporter->InternalError("Assertion failed: frame");
|
||||||
|
|
||||||
const BroFunc* func = frame->GetFunction();
|
const BroFunc* func = frame->GetFunction();
|
||||||
if ( func )
|
if ( func )
|
||||||
|
|
|
@ -300,7 +300,7 @@ FILE* BroFile::BringIntoCache()
|
||||||
UpdateFileSize();
|
UpdateFileSize();
|
||||||
|
|
||||||
if ( fseek(f, position, SEEK_SET) < 0 )
|
if ( fseek(f, position, SEEK_SET) < 0 )
|
||||||
reporter->Error("reopen seek failed", this);
|
reporter->Error("reopen seek failed");
|
||||||
|
|
||||||
InsertAtBeginning();
|
InsertAtBeginning();
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ FILE* BroFile::Seek(long new_position)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ( fseek(f, new_position, SEEK_SET) < 0 )
|
if ( fseek(f, new_position, SEEK_SET) < 0 )
|
||||||
reporter->Error("seek failed", this);
|
reporter->Error("seek failed");
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ void BroFile::SetBuf(bool arg_buffered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( setvbuf(f, NULL, arg_buffered ? _IOFBF : _IOLBF, 0) != 0 )
|
if ( setvbuf(f, NULL, arg_buffered ? _IOFBF : _IOLBF, 0) != 0 )
|
||||||
reporter->Error("setvbuf failed", this);
|
reporter->Error("setvbuf failed");
|
||||||
|
|
||||||
buffered = arg_buffered;
|
buffered = arg_buffered;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ void BroFile::Suspend()
|
||||||
|
|
||||||
if ( (position = ftell(f)) < 0 )
|
if ( (position = ftell(f)) < 0 )
|
||||||
{
|
{
|
||||||
reporter->Error("ftell failed", this);
|
reporter->Error("ftell failed");
|
||||||
position = 0;
|
position = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ bool RuleMatcher::ReadFiles(const name_list& files)
|
||||||
rules_in = search_for_file(files[i], "sig", 0, false, 0);
|
rules_in = search_for_file(files[i], "sig", 0, false, 0);
|
||||||
if ( ! rules_in )
|
if ( ! rules_in )
|
||||||
{
|
{
|
||||||
reporter->Error("Can't open signature file", files[i]);
|
reporter->Error("Can't open signature file %s", files[i]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ ID* lookup_ID(const char* name, const char* curr_module, bool no_global,
|
||||||
if ( id )
|
if ( id )
|
||||||
{
|
{
|
||||||
if ( need_export && ! id->IsExport() && ! in_debug )
|
if ( need_export && ! id->IsExport() && ! in_debug )
|
||||||
reporter->Error("identifier is not exported:",
|
reporter->Error("identifier is not exported: %s",
|
||||||
fullname.c_str());
|
fullname.c_str());
|
||||||
|
|
||||||
Ref(id);
|
Ref(id);
|
||||||
|
|
|
@ -930,7 +930,7 @@ void RecordType::Init(TypeList* arg_base)
|
||||||
|
|
||||||
if ( fields->Lookup(tdij->id) )
|
if ( fields->Lookup(tdij->id) )
|
||||||
{
|
{
|
||||||
reporter->Error("duplicate field", tdij->id);
|
reporter->Error("duplicate field %s", tdij->id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1091,7 +1091,7 @@ static uint32 parse_dotted(const char* text, int& dots)
|
||||||
{
|
{
|
||||||
if ( addr[i] < 0 || addr[i] > 255 )
|
if ( addr[i] < 0 || addr[i] > 255 )
|
||||||
{
|
{
|
||||||
reporter->Error("bad dotted address", text);
|
reporter->Error("bad dotted address %s", text);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,14 +228,14 @@ uint32 dotted_to_addr(const char* addr_text)
|
||||||
if ( sscanf(addr_text,
|
if ( sscanf(addr_text,
|
||||||
"%d.%d.%d.%d", addr+0, addr+1, addr+2, addr+3) != 4 )
|
"%d.%d.%d.%d", addr+0, addr+1, addr+2, addr+3) != 4 )
|
||||||
{
|
{
|
||||||
reporter->Error("bad dotted address:", addr_text );
|
reporter->Error("bad dotted address: %s", addr_text );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( addr[0] < 0 || addr[1] < 0 || addr[2] < 0 || addr[3] < 0 ||
|
if ( addr[0] < 0 || addr[1] < 0 || addr[2] < 0 || addr[3] < 0 ||
|
||||||
addr[0] > 255 || addr[1] > 255 || addr[2] > 255 || addr[3] > 255 )
|
addr[0] > 255 || addr[1] > 255 || addr[2] > 255 || addr[3] > 255 )
|
||||||
{
|
{
|
||||||
reporter->Error("bad dotted address:", addr_text);
|
reporter->Error("bad dotted address: %s", addr_text);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ uint32* dotted_to_addr6(const char* addr_text)
|
||||||
uint32* addr = new uint32[4];
|
uint32* addr = new uint32[4];
|
||||||
if ( inet_pton(AF_INET6, addr_text, addr) <= 0 )
|
if ( inet_pton(AF_INET6, addr_text, addr) <= 0 )
|
||||||
{
|
{
|
||||||
reporter->Error("bad IPv6 address:", addr_text );
|
reporter->Error("bad IPv6 address: %s", addr_text );
|
||||||
addr[0] = addr[1] = addr[2] = addr[3] = 0;
|
addr[0] = addr[1] = addr[2] = addr[3] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ uint32 mask_addr(uint32 a, uint32 top_bits_to_keep)
|
||||||
{
|
{
|
||||||
if ( top_bits_to_keep > 32 )
|
if ( top_bits_to_keep > 32 )
|
||||||
{
|
{
|
||||||
reporter->Error("bad address mask value", top_bits_to_keep);
|
reporter->Error("bad address mask value %s", top_bits_to_keep);
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ const uint32* mask_addr(const uint32* a, uint32 top_bits_to_keep)
|
||||||
|
|
||||||
if ( top_bits_to_keep == 0 || top_bits_to_keep > max_bits )
|
if ( top_bits_to_keep == 0 || top_bits_to_keep > max_bits )
|
||||||
{
|
{
|
||||||
reporter->Error("bad address mask value", top_bits_to_keep);
|
reporter->Error("bad address mask value %s", top_bits_to_keep);
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ int expand_escape(const char*& s)
|
||||||
int result;
|
int result;
|
||||||
if ( sscanf(start, "%3o", &result) != 1 )
|
if ( sscanf(start, "%3o", &result) != 1 )
|
||||||
{
|
{
|
||||||
reporter->Warning("bad octal escape: ", start);
|
reporter->Warning("bad octal escape: %s ", start);
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ int expand_escape(const char*& s)
|
||||||
int result;
|
int result;
|
||||||
if ( sscanf(start, "%2x", &result) != 1 )
|
if ( sscanf(start, "%2x", &result) != 1 )
|
||||||
{
|
{
|
||||||
reporter->Warning("bad hexadecimal escape: ", start);
|
reporter->Warning("bad hexadecimal escape: %s", start);
|
||||||
result = 0;
|
result = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue