Added readOptionalTimeMillisecondsDTagElement
diff --git a/ndn-cpp/c/encoding/BinaryXMLInterest.c b/ndn-cpp/c/encoding/BinaryXMLInterest.c
index 2ba6e66..337ca0f 100644
--- a/ndn-cpp/c/encoding/BinaryXMLInterest.c
+++ b/ndn-cpp/c/encoding/BinaryXMLInterest.c
@@ -216,20 +216,9 @@
(decoder, ndn_BinaryXML_DTag_Scope, &interest->scope))
return error;
- if (error = ndn_BinaryXMLDecoder_peekDTag(decoder, ndn_BinaryXML_DTag_InterestLifetime, &gotExpectedTag))
+ if (error= ndn_BinaryXMLDecoder_readOptionalTimeMillisecondsDTagElement
+ (decoder, ndn_BinaryXML_DTag_InterestLifetime, &interest->interestLifetimeMilliseconds))
return error;
- if (gotExpectedTag) {
- unsigned char *interestLifetime;
- unsigned int interestLifetimeLength;
- if (error = ndn_BinaryXMLDecoder_readBinaryDTagElement
- (decoder, ndn_BinaryXML_DTag_InterestLifetime, 0, &interestLifetime, &interestLifetimeLength))
- return error;
-
- interest->interestLifetimeMilliseconds = 1000.0 *
- ndn_BinaryXMLDecoder_unsignedBigEndianToDouble(interestLifetime, interestLifetimeLength) / 4096.0;
- }
- else
- interest->interestLifetimeMilliseconds = -1.0;
if (error = ndn_BinaryXMLDecoder_readOptionalBinaryDTagElement
(decoder, ndn_BinaryXML_DTag_Nonce, 0, &interest->nonce, &interest->nonceLength))