Serialize string length on 16 bits
This commit is contained in:
committed by
Patrick Nicolas
parent
a7f9ac2d74
commit
1ec1f23862
@@ -329,14 +329,14 @@ struct serialization_traits<std::string>
|
||||
|
||||
static void serialize(const std::string & value, serialization_packet & packet)
|
||||
{
|
||||
packet.serialize<uint64_t>(value.size());
|
||||
packet.serialize<uint16_t>(value.size());
|
||||
packet.write(value.data(), value.size());
|
||||
}
|
||||
|
||||
static std::string deserialize(deserialization_packet & packet)
|
||||
{
|
||||
std::string value;
|
||||
size_t size = packet.deserialize<uint64_t>();
|
||||
size_t size = packet.deserialize<uint16_t>();
|
||||
|
||||
packet.check_remaining_size(size);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user