mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
cluster/serializer/broker: Do not send empty metadata vectors around
Event when there's no metadata attached to an event, we'd still use the constructor passing an empty metadata vector, resulting in an on-the-wire representation with an empty trailing vector. Particularly visible when just snooping events via websocat. There also seems to be some bug with the timestamp -1 handling.
This commit is contained in:
parent
c9c5959d49
commit
01fe022e07
15 changed files with 162 additions and 3 deletions
|
@ -66,8 +66,8 @@ std::optional<broker::zeek::Event> detail::to_broker_event(const zeek::cluster::
|
|||
}
|
||||
|
||||
// Convert metadata from the cluster::detail::Event event to broker's event metadata format.
|
||||
broker::vector broker_meta;
|
||||
if ( const auto* meta = ev.Metadata(); meta != nullptr ) {
|
||||
broker::vector broker_meta;
|
||||
broker_meta.reserve(meta->size());
|
||||
|
||||
for ( const auto& m : *meta ) {
|
||||
|
@ -81,9 +81,11 @@ std::optional<broker::zeek::Event> detail::to_broker_event(const zeek::cluster::
|
|||
obj_desc_short(m.Val()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return broker::zeek::Event(ev.HandlerName(), xs, broker_meta);
|
||||
}
|
||||
|
||||
return broker::zeek::Event(ev.HandlerName(), xs, broker_meta);
|
||||
return broker::zeek::Event(ev.HandlerName(), xs);
|
||||
}
|
||||
|
||||
std::optional<zeek::cluster::Event> detail::to_zeek_event(const broker::zeek::Event& ev) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue