mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Prevent double-wrapping Broker::Data in published event args
In the following example, the republication of "arg" would result in literally sending it as a Broker::Data record instead of the broker data that it was already wrapping. Sender: Broker::publish("topic", my_event, "hello") Receiver: event my_event(arg: any) { Broker::publish("topic", my_event, arg) }
This commit is contained in:
parent
e33a3a9c02
commit
06e7f18a32
4 changed files with 20 additions and 4 deletions
|
@ -815,7 +815,15 @@ RecordVal* Manager::MakeEvent(val_list* args, Frame* frame)
|
|||
return rval;
|
||||
}
|
||||
|
||||
auto data_val = make_data_val((*args)[i]);
|
||||
RecordVal* data_val;
|
||||
|
||||
if ( same_type(got_type, bro_broker::DataVal::ScriptDataType()) )
|
||||
{
|
||||
data_val = (*args)[i]->AsRecordVal();
|
||||
Ref(data_val);
|
||||
}
|
||||
else
|
||||
data_val = make_data_val((*args)[i]);
|
||||
|
||||
if ( ! data_val->Lookup(0) )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue