mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Prevent recursion of &on_change handlers.
This change prevents &on_change handlers for a table from running if an &on_change handler for the same table is already running.
This commit is contained in:
parent
7166cb7373
commit
7f9f66fce9
5 changed files with 46 additions and 3 deletions
|
@ -1933,7 +1933,7 @@ ListVal* TableVal::RecoverIndex(const HashKey* k) const
|
|||
|
||||
void TableVal::CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe)
|
||||
{
|
||||
if ( ! change_func || ! index )
|
||||
if ( ! change_func || ! index || in_change_func )
|
||||
return;
|
||||
|
||||
if ( ! table_type->IsSet() && ! old_value )
|
||||
|
@ -1978,12 +1978,15 @@ void TableVal::CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe
|
|||
if ( ! table_type->IsSet() )
|
||||
vl.append(old_value->Ref());
|
||||
|
||||
in_change_func = true;
|
||||
f->Call(&vl);
|
||||
Unref(thefunc);
|
||||
}
|
||||
catch ( InterpreterException& e )
|
||||
{
|
||||
}
|
||||
|
||||
in_change_func = false;
|
||||
}
|
||||
|
||||
Val* TableVal::Delete(const Val* index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue