tools: ndnputfile

Change-Id: Iebf2367be4fefaf903fc9210156345e98582eb06
Refs: #1513
diff --git a/ndn-handle/write-handle.cpp b/ndn-handle/write-handle.cpp
index c67e775..0ea17ae 100644
--- a/ndn-handle/write-handle.cpp
+++ b/ndn-handle/write-handle.cpp
@@ -294,7 +294,7 @@
   nextSegmentQueue.pop();
 
   //check whether sendingSegment exceeds
-  if (sendingSegment > response.getEndBlockId()) {
+  if (response.hasEndBlockId() && sendingSegment > response.getEndBlockId()) {
     //do not do anything
     return;
   }
@@ -327,7 +327,7 @@
     retryCounts[sendingSegment] = retryCounts[sendingSegment] + 1;
   }
   //increase the next seg and put it into the queue
-  if ((nextSegment + 1) <= response.getEndBlockId()) {
+  if (!response.hasEndBlockId() || (nextSegment + 1) <= response.getEndBlockId()) {
     nextSegment++;
     nextSegmentQueue.push(nextSegment);
   }