Fix packer: store span_writer by reference, not copy

This commit is contained in:
Ian Gulliver
2026-04-10 23:23:58 +09:00
parent 7264611f99
commit f6d8847bcf
2 changed files with 6 additions and 5 deletions

View File

@@ -115,7 +115,8 @@ inline msgpack::result<size_t> encode_response_into(span_writer &out, uint32_t m
body_p.pack(msg.as_tuple());
auto inner_ext = out.subspan(envelope_hdr_len, ext16_header_len);
msgpack::packer(inner_ext).pack_ext16_header(T::ext_id, static_cast<uint16_t>(body.size()));
msgpack::packer inner_ext_p(inner_ext);
inner_ext_p.pack_ext16_header(T::ext_id, static_cast<uint16_t>(body.size()));
size_t bin_len = inner_ext.size() + body.size();
uint32_t checksum = halfsiphash::hash32({inner_ext.data(), bin_len}, hash_key);