mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
idl: remove for_each from fragmented serialization
Previously fragmented buffers of bytes were serialized with a for_each loop. Since serializing bytes involves writing size first and then data, only first fragment (and its size) would be taken into account. This commit changes fragmented code generation so it expects that serialized range has a serialize(output, T) specification and expects it to iterate over fragments on its own (just like serializer for basic_value_view does). Fixes #3501
This commit is contained in:
@@ -439,10 +439,7 @@ def add_param_writer_basic_type(name, base_state, typ, var_type = "", var_index
|
||||
GCC6_CONCEPT(requires FragmentRange<FragmentedBuffer>)
|
||||
after_${base_state}__$name<Output> write_fragmented_$name$var_type(FragmentedBuffer&& fragments) && {
|
||||
$set_varient_index
|
||||
using boost::range::for_each;
|
||||
for_each(fragments, [&] ($typ t) {
|
||||
serialize(_out, t);
|
||||
});
|
||||
serialize_fragmented(_out, std::forward<FragmentedBuffer>(fragments));
|
||||
$set_command
|
||||
return $return_command;
|
||||
}""")).substitute(locals())
|
||||
|
||||
Reference in New Issue
Block a user