management: Making LocalControlHeader encoding independent of Interest/Data wire
Boost.Asio support multi-buffer send operation, which is enabled in this
commit for prepending (potentially different) LocalControlHeader's to
Interest/Data wire.
Change-Id: I39b979f89f196d3e47d6466fb71f6d440bce74d4
refs: #1265
diff --git a/src/face.cpp b/src/face.cpp
index 3f95cf9..e362864 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -105,7 +105,16 @@
m_pendingInterestTable.push_back(shared_ptr<PendingInterest>(new PendingInterest
(interest, onData, onTimeout)));
- m_transport->send(interest->getLocalControlHeader().wireEncode(*interest));
+ if (!interest->getLocalControlHeader().empty(false, true))
+ {
+ // encode only NextHopFaceId towards the forwarder
+ m_transport->send(interest->getLocalControlHeader().wireEncode(*interest, false, true),
+ interest->wireEncode());
+ }
+ else
+ {
+ m_transport->send(interest->wireEncode());
+ }
if (!m_pitTimeoutCheckTimerActive) {
m_pitTimeoutCheckTimerActive = true;
@@ -121,7 +130,15 @@
m_transport->connect(*m_ioService,
bind(&Face::onReceiveElement, this, _1));
- m_transport->send(data.getLocalControlHeader().wireEncode(data));
+ if (!data.getLocalControlHeader().empty(false, true))
+ {
+ m_transport->send(data.wireEncode());
+ }
+ else
+ {
+ m_transport->send(data.getLocalControlHeader().wireEncode(data, false, true),
+ data.wireEncode());
+ }
}
void