diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2020-03-09 13:25:28 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-03-09 13:25:28 +0000 |
commit | 01d76a603fba7db5cfb83a1fbc3b369f2e4a4823 (patch) | |
tree | 486f541ca2ca90ed1d117dad1920f23725eed38e /libtransport/src/protocols/byte_stream_reassembly.cc | |
parent | 0f7b6da4aeeb6ed9baffb47d72aa176556145501 (diff) | |
parent | afe807c61372fe2481e73af63c8382af1e1d3011 (diff) |
Merge "[HICN-540] Optimizations for libhicntransport"
Diffstat (limited to 'libtransport/src/protocols/byte_stream_reassembly.cc')
-rw-r--r-- | libtransport/src/protocols/byte_stream_reassembly.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libtransport/src/protocols/byte_stream_reassembly.cc b/libtransport/src/protocols/byte_stream_reassembly.cc index c2996ebc1..e15498bb1 100644 --- a/libtransport/src/protocols/byte_stream_reassembly.cc +++ b/libtransport/src/protocols/byte_stream_reassembly.cc @@ -80,19 +80,19 @@ void ByteStreamReassembly::assembleContent() { } void ByteStreamReassembly::copyContent(const ContentObject &content_object) { - auto a = content_object.getPayload(); - auto payload_length = a->length(); + auto payload = content_object.getPayloadReference(); + auto payload_length = payload.second; auto write_size = std::min(payload_length, read_buffer_->tailroom()); auto additional_bytes = payload_length > read_buffer_->tailroom() ? payload_length - read_buffer_->tailroom() : 0; - std::memcpy(read_buffer_->writableTail(), a->data(), write_size); + std::memcpy(read_buffer_->writableTail(), payload.first, write_size); read_buffer_->append(write_size); if (!read_buffer_->tailroom()) { notifyApplication(); - std::memcpy(read_buffer_->writableTail(), a->data() + write_size, + std::memcpy(read_buffer_->writableTail(), payload.first + write_size, additional_bytes); read_buffer_->append(additional_bytes); } |