mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Communication must now be enabled explicitly.
The communication subsystem is now disabled until a new BiF, enable_communication(), is called. The base scripts do this automatically when either a Communication::Node is defined, or Bro is asked to listen for incoming connections.
This commit is contained in:
parent
0e2a1605b3
commit
103396f6d3
9 changed files with 27 additions and 43 deletions
26
src/Expr.cc
26
src/Expr.cc
|
@ -231,7 +231,6 @@ bool Expr::DoUnserialize(UnserialInfo* info)
|
|||
NameExpr::NameExpr(ID* arg_id) : Expr(EXPR_NAME)
|
||||
{
|
||||
id = arg_id;
|
||||
ReferenceID();
|
||||
SetType(id->Type()->Ref());
|
||||
|
||||
EventHandler* h = event_registry->Lookup(id->Name());
|
||||
|
@ -244,29 +243,6 @@ NameExpr::~NameExpr()
|
|||
Unref(id);
|
||||
}
|
||||
|
||||
void NameExpr::ReferenceID()
|
||||
{
|
||||
// ### This is a hack. We check whether one of the remote serializer's
|
||||
// built-in functions is referenced. If so, we activate the serializer.
|
||||
// A better solution would be to either (1) a generic mechanism in
|
||||
// which have (internal) attributes associated with identifiers and
|
||||
// as we see references to the identifiers, we do bookkeeping
|
||||
// associated with their attribute (so in this case the attribute
|
||||
// would be "flag that inter-Bro communication is being used"),
|
||||
// or (2) after the parse is done, we'd query whether these
|
||||
// particular identifiers were seen, rather than doing the test
|
||||
// here for every NameExpr we create.
|
||||
if ( id->Type()->Tag() == TYPE_FUNC )
|
||||
{
|
||||
const char* const* builtins = remote_serializer->GetBuiltins();
|
||||
while( *builtins )
|
||||
{
|
||||
if ( streq(id->Name(), *builtins++) )
|
||||
using_communication = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Expr* NameExpr::Simplify(SimplifyType simp_type)
|
||||
{
|
||||
if ( simp_type != SIMPLIFY_LHS && id->IsConst() )
|
||||
|
@ -393,8 +369,6 @@ bool NameExpr::DoUnserialize(UnserialInfo* info)
|
|||
if ( ! id )
|
||||
return false;
|
||||
|
||||
ReferenceID();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue