<div style="line-height:1.6;font-size:16px;font-family:'苹方','微软雅黑','sans-serif';">Thank for replaying.I have modified them,and I also modify the tlv.h(add   <br/>a type "Digest"),but still have segment false<br/><br/>----- <br/>研究生 <br/>下一代互联网国家工程实验室 <br/>北京交通大学 <br/>寸怡鹏 <br/> <br/>Mob: (+86) 13238752918 <br/>Email: cunyipeng@bjtu.edu.cn<br/><br/></div><div class='ne-quoted'><blockquote id='ntes-andriodmail-quote' style="margin:0px !important;padding:0px !important;border: none !important;"><div class="J-reply" style="background-color:#f2f2f2;color:black;padding-top:6px;padding-bottom:6px;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;margin-top:45px;margin-bottom:20px;">
    <div style="font-size:14px;line-height:1.5;word-break:break-all;margin-left:10px;margin-right:10px">在<span class="mail-date">2017年05月12日 11:20</span>,<a class="mail-to" style="text-decoration:none;color:#2a97ff;" href="mailto:mastorakis@cs.ucla.edu">Spyridon (Spyros) Mastorakis</a> 写道:</div>
</div><html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">you have to modify the wireEncode and wireDecode methods to encode/decode the newly added field in the appropriate way.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div><div class=""><br class=""></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On May 9, 2017, at 7:00 PM, <a href="mailto:16120054@bjtu.edu.cn" class="">16120054@bjtu.edu.cn</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: 'Microsoft YaHei UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline"><br class=""></div><hr size="1" align="left" style="font-family: 'Microsoft YaHei UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; width: 210px; height: 1px;" class=""><div style="font-family: 'Microsoft YaHei UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class=""><div style="margin: 10px; font-family: verdana; font-size: 10pt;" class=""><div class=""><a href="mailto:16120054@bjtu.edu.cn" class="">16120054@bjtu.edu.cn</a></div></div></span></div><blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; font-family: 'Microsoft YaHei UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""> </div><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="padding: 8px; font-size: 12px; font-family: tahoma; background-color: rgb(239, 239, 239);" class=""><div class=""><b class="">发件人:</b> <a href="mailto:16120054@bjtu.edu.cn" class="">16120054@bjtu.edu.cn</a></div><div class=""><b class="">发送时间:</b> 2017-05-10 09:29</div><div class=""><b class="">收件人:</b> <a href="mailto:nfd-dev@lists.cs.ucla.edu" class="">nfd-dev</a></div><div class=""><b class="">主题:</b> Problems</div></div></div><div class=""><div class="FoxDiv20170510100018487078"><font face="Tahoma" class="">Hello!</font><div class=""><font face="Tahoma" class="">    I add a data parket field in the data.cpp ,such as</font></div><div class=""><font face="Tahoma" class="">  </font><span style="background-color: rgba(0, 0, 0, 0); font-family: Tahoma; font-size: 10.5pt; line-height: 1.5;" class="">template<encoding::Tag TAG></span></div><span style="font-family: Tahoma; background-color: rgba(0, 0, 0, 0);" class="">size_t<br class="">Data::wireEncode(EncodingImpl<TAG>& encoder, bool unsignedPortion/* = false*/) const<br class="">{<br class="">  size_t totalLength = 0;<br class=""><br class="">  // Data ::= DATA-TLV TLV-LENGTH<br class="">  //            Name<br class="">  //            MetaInfo<br class="">  //            Content<br class="">  //            Signature<br class="">  //<span style="white-space: pre;" class="">  </span>        Digest<br class=""><br class="">  // (reverse encoding)<br class=""><br class="">  if (!unsignedPortion && !m_signature)<br class="">  {<br class="">      BOOST_THROW_EXCEPTION(Error("Requested wire format, but data packet has not been signed yet"));<br class="">  }<br class=""><br class="">  // Digest<br class="">  totalLength += encoder.prependBlock(getDigest());<br class=""><br class="">  if (!unsignedPortion)<br class="">  {<br class="">      // SignatureValue<br class="">      totalLength += encoder.prependBlock(m_signature.getValue());<br class="">  }<br class=""><br class="">  // SignatureInfo<br class="">  totalLength += encoder.prependBlock(m_signature.getInfo());<br class=""><br class="">  // Content<br class="">  totalLength += encoder.prependBlock(getContent());<br class=""><br class="">  // MetaInfo<br class="">  totalLength += getMetaInfo().wireEncode(encoder);<br class=""><br class="">  // Name<br class="">  totalLength += getName().wireEncode(encoder);<br class=""><br class=""><br class="">  if (!unsignedPortion)<br class="">    {<br class="">      totalLength += encoder.prependVarNumber(totalLength);<br class="">      totalLength += encoder.prependVarNumber(tlv::Data);<br class="">    }<br class="">  return totalLength;<br class="">}</span><div class=""><font face="Tahoma" class=""><br class=""></font></div><div class=""><font face="Tahoma" class="">  </font><span style="font-family: Tahoma; background-color: rgba(0, 0, 0, 0);" class="">const Block&<br class="">Data::getDigest() const<br class="">{<br class="">  if (m_fullName1.empty())<br class="">    m_fullName1 = makeEmptyBlock(tlv::Digest);<br class=""><br class="">  if (!m_fullName1.hasWire())<br class="">    m_fullName1.encode();<br class="">  return m_fullName1;<br class="">}<br class=""><br class="">Data&<br class="">Data::setDigest(const Block& fullname)<br class="">{<br class="">  onChanged();<br class="">  if (fullname.type() == tlv::Digest)<br class="">      m_fullName1 = fullname;<br class="">  else {<br class="">       m_fullName1 = Block(tlv::Digest, fullname);<br class="">  }<br class="">  return *this;<br class="">}<br class=""><br class=""><br class="">Data&<br class="">Data::setDigest(const uint8_t* fullname, size_t fullnameLength)<br class="">{<br class="">   onChanged();<br class=""><br class="">   m_fullName1 = makeBinaryBlock(tlv::Digest, fullname, fullnameLength);<br class=""><br class="">   return *this;<br class=""> }</span></div><div class=""><font face="Tahoma" class=""><br class=""></font></div><div class=""><font face="Tahoma" class=""><br class=""></font></div><div class=""><font face="Tahoma" class=""> But, program always shows that "</font><span style="font-family: Tahoma; background-color: rgba(0, 0, 0, 0);" class="">terminated with signal SIGSEGV",I don't konw how to solve it.</span><font face="Tahoma" class=""><br class=""></font><div style="font-family: Tahoma;" class=""><br class=""></div><div style="font-family: Tahoma;" class=""><br class=""></div><div class=""></div><div class=""><hr align="left" size="1" style="font-size: 14px; line-height: 21px; width: 210px; height: 1px;" class=""><div style="font-size: 14px; line-height: 21px;" class=""><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class=""><div class="">研究生</div><div class="">下一代互联网国家工程实验室</div></div><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class="">北京交通大学</div><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class="">寸怡鹏</div><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class=""><br class=""></div><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class="">Mob: (+86) 13238752918</div><div style="font-family: 'Microsoft YaHei UI', Tahoma; line-height: normal;" class="">Email: <span style="font-family: tahoma, verdana, sans-serif; font-size: 12px;" class=""><a href="mailto:16120168@bjtu.edu.cn" class="" style="text-decoration: none !important;">cunyipeng@bjtu.edu.cn</a></span></div></div></div></div></div></div></blockquote><br class=""></div></blockquote></div><br class=""></div></body></html>
</blockquote></div>