model-wire: Fixing compliance with CCNb format regarding Content tag
Previously, content didn't contain a proper BLOB tag
Refs #1020 (http://redmine.named-data.net/issues/1020)
diff --git a/model/wire/ccnb/wire-ccnb-data.cc b/model/wire/ccnb/wire-ccnb-data.cc
index 0770c3d..e625e06 100644
--- a/model/wire/ccnb/wire-ccnb-data.cc
+++ b/model/wire/ccnb/wire-ccnb-data.cc
@@ -246,6 +246,10 @@
Ccnb::AppendBlockHeader (start, CcnbParser::CCN_DTAG_Content, CcnbParser::CCN_DTAG); // <Content>
+ uint32_t payloadSize = m_data->GetPayload ()->GetSize ();
+ if (payloadSize > 0)
+ Ccnb::AppendBlockHeader (start, payloadSize, CcnbParser::CCN_BLOB);
+
// there are no closing tags !!!
// The closing tag is handled by ContentObjectTail
}
@@ -319,6 +323,10 @@
written += Ccnb::EstimateBlockHeader (CcnbParser::CCN_DTAG_Content); // <Content>
+ uint32_t payloadSize = m_data->GetPayload ()->GetSize ();
+ if (payloadSize > 0)
+ written += Ccnb::EstimateBlockHeader (payloadSize);
+
// there are no closing tags !!!
// The closing tag is handled by ContentObjectTail
return written;