summaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-03-23 21:00:43 +0100
committerMauro Sardara <msardara@cisco.com>2019-03-23 21:06:32 +0100
commitf9790f48a9f8c91e0c2142d7030b7e0f27c104f0 (patch)
tree658417484024abee41e5f3bbd7da27c2abcc51cc /libtransport
parent1ad06afe9f952642a26f4d28239cf05eb3283eb7 (diff)
[HICN-6] ATS fixes
Change-Id: I1e9a214ead9d4d9bacd98d797371783ad39909f7 Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/core/packet.cc8
-rw-r--r--libtransport/src/hicn/transport/core/packet.h2
-rw-r--r--libtransport/src/hicn/transport/protocols/packet_manager.h1
-rw-r--r--libtransport/src/hicn/transport/protocols/raaqm.cc5
4 files changed, 15 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/core/packet.cc b/libtransport/src/hicn/transport/core/packet.cc
index de8ede421..954266664 100644
--- a/libtransport/src/hicn/transport/core/packet.cc
+++ b/libtransport/src/hicn/transport/core/packet.cc
@@ -594,6 +594,14 @@ void Packet::separateHeaderPayload() {
packet_->append(header_size);
}
+void Packet::resetPayload() {
+ if (packet_->isChained()) {
+ packet_->separateChain(packet_->next(), packet_->prev());
+ payload_head_ = nullptr;
+ updateLength();
+ }
+}
+
} // end namespace core
} // end namespace transport
diff --git a/libtransport/src/hicn/transport/core/packet.h b/libtransport/src/hicn/transport/core/packet.h
index 6d8bc7e0f..4ec93205a 100644
--- a/libtransport/src/hicn/transport/core/packet.h
+++ b/libtransport/src/hicn/transport/core/packet.h
@@ -178,6 +178,8 @@ class Packet : public std::enable_shared_from_this<Packet> {
Packet &setTTL(uint8_t hops);
uint8_t getTTL() const;
+ void resetPayload();
+
private:
virtual void resetForHash() = 0;
void setSignatureSize(std::size_t size_bytes);
diff --git a/libtransport/src/hicn/transport/protocols/packet_manager.h b/libtransport/src/hicn/transport/protocols/packet_manager.h
index 53486edde..4d4011ecf 100644
--- a/libtransport/src/hicn/transport/protocols/packet_manager.h
+++ b/libtransport/src/hicn/transport/protocols/packet_manager.h
@@ -53,6 +53,7 @@ class PacketManager {
result = interest_pool_.get();
}
+ result.second->resetPayload();
return std::move(result.second);
}
diff --git a/libtransport/src/hicn/transport/protocols/raaqm.cc b/libtransport/src/hicn/transport/protocols/raaqm.cc
index be76f7c23..b10457f40 100644
--- a/libtransport/src/hicn/transport/protocols/raaqm.cc
+++ b/libtransport/src/hicn/transport/protocols/raaqm.cc
@@ -102,6 +102,9 @@ void RaaqmTransportProtocol::reset() {
core::Name *name;
socket_->getSocketOption(GeneralTransportOptions::NETWORK_NAME, &name);
index_manager_->setFirstSuffix(name->getSuffix());
+ std::queue<Interest::Ptr> empty;
+ std::swap(interest_to_retransmit_, empty);
+ current_window_size_ = 1;
// Reset reassembly component
BaseReassembly::reset();
@@ -484,7 +487,7 @@ void RaaqmTransportProtocol::sendInterest(std::uint64_t next_suffix) {
return;
}
- interest_retransmissions_[next_suffix & mask] = ~0;
+ interest_retransmissions_[next_suffix & mask] = 0;
interest_timepoints_[next_suffix & mask] = utils::SteadyClock::now();
sendInterest(std::move(interest));
}