diff options
author | michele papalini <micpapal@cisco.com> | 2019-11-22 09:50:31 +0100 |
---|---|---|
committer | michele papalini <micpapal@cisco.com> | 2019-11-22 09:50:31 +0100 |
commit | 848f339ec9419bd9d1bd90414eeb9320c4067b08 (patch) | |
tree | c5af1f9fac600cad6362a1d0acd7bc9f511934e0 /libtransport/src | |
parent | 3638de122f58225253eedbbfd125951ec56a1fa1 (diff) |
[HICN-409] remove race condition in rtc procuder socket
Signed-off-by: michele papalini <micpapal@cisco.com>
Change-Id: Ifdc5d912b8687bae3da78fadb05524d78e767f5a
Diffstat (limited to 'libtransport/src')
-rw-r--r-- | libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc index c1a45ebb7..f1057aa57 100644 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc @@ -150,8 +150,9 @@ void RTCProducerSocket::produce(std::unique_ptr<utils::MemBuf> &&buffer) { producedBytes_ += (uint32_t)(buffer_size + headerSize_ + TIMESTAMP_LEN); producedPackets_++; + Name n(flowName_); auto content_object = - std::make_shared<ContentObject>(flowName_.setSuffix(currentSeg_.load())); + std::make_shared<ContentObject>(n.setSuffix(currentSeg_.load())); auto payload = utils::MemBuf::create(TIMESTAMP_LEN); memcpy(payload->writableData(), &now, TIMESTAMP_LEN); @@ -340,8 +341,9 @@ void RTCProducerSocket::sendNack(uint32_t sequence) { nack_payload->append(NACK_HEADER_SIZE); ContentObject nack; + Name n(flowName_); nack.appendPayload(std::move(nack_payload)); - nack.setName(flowName_.setSuffix(sequence)); + nack.setName(n.setSuffix(sequence)); uint32_t *payload_ptr = (uint32_t *)nack.getPayload()->data(); *payload_ptr = currentSeg_.load(); |