[HICN-338] correctly compute the estimated production rate in rtc socket 32/22832/1
authormichele papalini <micpapal@cisco.com>
Fri, 18 Oct 2019 11:20:17 +0000 (13:20 +0200)
committermichele papalini <micpapal@cisco.com>
Fri, 18 Oct 2019 11:20:17 +0000 (13:20 +0200)
Signed-off-by: michele papalini <micpapal@cisco.com>
Change-Id: I5ab36c5dde449ff0f3e0372372c09dbb227aecf5

libtransport/src/hicn/transport/protocols/rtc.cc

index ba8f549..db36473 100644 (file)
@@ -803,6 +803,9 @@ void RTCTransportProtocol::onContentObject(
     avgPacketSize_ = (HICN_ESTIMATED_PACKET_SIZE * avgPacketSize_) +
                      ((1 - HICN_ESTIMATED_PACKET_SIZE) * payload->length());
 
+    receivedBytes_ += (uint32_t)(content_object->headerSize() +
+                                   content_object->payloadSize());
+
     if (inflightInterests_[pkt].state == sent_) {
       inflightInterestsCount_--;  // packet sent without timeouts
     }
@@ -810,10 +813,7 @@ void RTCTransportProtocol::onContentObject(
     if (inflightInterests_[pkt].state == sent_ &&
         interestRetransmissions_.find(segmentNumber) ==
             interestRetransmissions_.end()) {
-      // we count only non retransmitted data in order to take into accunt only
-      // the transmition rate of the producer
-      receivedBytes_ += (uint32_t)(content_object->headerSize() +
-                                   content_object->payloadSize());
+      // delay stats are computed only for non retransmitted data
       updateDelayStats(*content_object);
     }