core: Force SegmentPublisher to publish at least one Data packet, which could have empty content

Change-Id: I8338f78ebfa4c2641eaae606b28c1112f06619c9
Refs: #1662
diff --git a/core/segment-publisher.hpp b/core/segment-publisher.hpp
index 287b5ac..b1aa4a9 100644
--- a/core/segment-publisher.hpp
+++ b/core/segment-publisher.hpp
@@ -71,7 +71,7 @@
     const uint8_t* end = rawBuffer + buffer.size();
 
     uint64_t segmentNo = 0;
-    while (segmentBegin < end)
+    do
       {
         const uint8_t* segmentEnd = segmentBegin + getMaxSegmentSize();
         if (segmentEnd > end)
@@ -94,6 +94,7 @@
         publishSegment(data);
         segmentNo++;
       }
+    while (segmentBegin < end);
   }
 
 protected: