aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/protocols/byte_stream_reassembly.cc
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-03-09 13:25:28 +0000
committerGerrit Code Review <gerrit@fd.io>2020-03-09 13:25:28 +0000
commit01d76a603fba7db5cfb83a1fbc3b369f2e4a4823 (patch)
tree486f541ca2ca90ed1d117dad1920f23725eed38e /libtransport/src/protocols/byte_stream_reassembly.cc
parent0f7b6da4aeeb6ed9baffb47d72aa176556145501 (diff)
parentafe807c61372fe2481e73af63c8382af1e1d3011 (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.cc8
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);
}