summaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-27 19:45:48 +0100
committerMauro Sardara <msardara@cisco.com>2019-03-27 19:56:28 +0100
commit2d496e60ffdb694aad33b498550aede53392861b (patch)
treeb3d6089b7b35d14830abcf16944f5903bbe7138b /libtransport
parente7af5711a05311ac92d0f8c59986fea4032937c9 (diff)
[HICN-11] Fix segfault in rtc due to typo in variable name.
Change-Id: Id8fe64fb6d0748b3708f0bbd1e6e7d154cc04437 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/protocols/protocol.h1
-rw-r--r--libtransport/src/hicn/transport/protocols/rtc.cc8
2 files changed, 4 insertions, 5 deletions
diff --git a/libtransport/src/hicn/transport/protocols/protocol.h b/libtransport/src/hicn/transport/protocols/protocol.h
index 6911eada5..88889bb8c 100644
--- a/libtransport/src/hicn/transport/protocols/protocol.h
+++ b/libtransport/src/hicn/transport/protocols/protocol.h
@@ -62,7 +62,6 @@ class TransportProtocol : public interface::BasePortal::ConsumerCallback,
std::shared_ptr<interface::BasePortal> portal_;
volatile bool is_running_;
TransportStatistics stats_;
- std::shared_ptr<std::vector<uint8_t>> content_buffer_;
};
} // end namespace protocol
diff --git a/libtransport/src/hicn/transport/protocols/rtc.cc b/libtransport/src/hicn/transport/protocols/rtc.cc
index e07a4042b..a993d596b 100644
--- a/libtransport/src/hicn/transport/protocols/rtc.cc
+++ b/libtransport/src/hicn/transport/protocols/rtc.cc
@@ -419,7 +419,6 @@ void RTCTransportProtocol::sendInterest() {
return;
}
- using namespace std::placeholders;
portal_->sendInterest(std::move(interest));
sentInterest_++;
@@ -573,8 +572,9 @@ void RTCTransportProtocol::returnContentToApplication(
// return content to the user
auto a = content_object.getPayload();
- uint8_t *start = ((uint8_t *)a->data()) + HICN_TIMESTAMP_SIZE;
- unsigned size = (unsigned)(a->length() - HICN_TIMESTAMP_SIZE);
+ a->trimStart(HICN_TIMESTAMP_SIZE);
+ uint8_t *start = a->writableData();
+ unsigned size = (unsigned)a->length();
// set offset between hICN and RTP packets
uint16_t rtp_seq = ntohs(*(((uint16_t *)start) + 1));
@@ -582,7 +582,7 @@ void RTCTransportProtocol::returnContentToApplication(
std::shared_ptr<std::vector<uint8_t>> content_buffer;
socket_->getSocketOption(APPLICATION_BUFFER, content_buffer);
- content_buffer->insert(content_buffer_->end(), start, start + size);
+ content_buffer->insert(content_buffer->end(), start, start + size);
ConsumerContentCallback *on_payload = nullptr;
socket_->getSocketOption(CONTENT_RETRIEVED, &on_payload);