aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-04-09 11:26:15 +0200
committermichele papalini <micpapal@cisco.com>2019-04-09 11:26:15 +0200
commit610d7b9fb754d594271c7252af7b7811f9d3c00e (patch)
treeede86900a6c974b4494fcba84e7bab1112d97d4b /libtransport/src/hicn
parent9307374bf9dbf3805d97d90ffd04d7f41f2c61a0 (diff)
[HICN-173] bad initialization of bytesProductionRate in RTC producer socket
Change-Id: I1c11985aae1bdf1450b022e25f1c9f44b1bd3ec1 Signed-off-by: michele papalini <micpapal@cisco.com>
Diffstat (limited to 'libtransport/src/hicn')
-rw-r--r--libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
index cea421703..91406d74e 100644
--- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
@@ -49,7 +49,7 @@ RTCProducerSocket::RTCProducerSocket(asio::io_service &io_service)
nack_(std::make_shared<ContentObject>()),
producedBytes_(0),
producedPackets_(0),
- bytesProductionRate_(0),
+ bytesProductionRate_(INIT_PACKET_PRODUCTION_RATE * 1400),
packetsProductionRate_(INIT_PACKET_PRODUCTION_RATE),
perSecondFactor_(MILLI_IN_A_SEC / STATS_INTERVAL_DURATION),
active_(false) {
@@ -69,7 +69,7 @@ RTCProducerSocket::RTCProducerSocket()
nack_(std::make_shared<ContentObject>()),
producedBytes_(0),
producedPackets_(0),
- bytesProductionRate_(0),
+ bytesProductionRate_(INIT_PACKET_PRODUCTION_RATE * 1400),
packetsProductionRate_(INIT_PACKET_PRODUCTION_RATE),
perSecondFactor_(MILLI_IN_A_SEC / STATS_INTERVAL_DURATION),
active_(false) {
@@ -171,7 +171,8 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) {
uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now().time_since_epoch())
.count();
- if (now - lastProduced_.load() >= INACTIVE_TIME) {
+ uint64_t lastProduced = lastProduced_.load();
+ if (now - lastProduced >= INACTIVE_TIME) {
active_ = false;
}
}