Browse Source

HPCC-9182 Prevent adding empty FlushingStringBuffer block to queue

An empty block in the FlushingStringBuffer queue will be treated
as end of content.

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
Anthony Fishbeck 12 years ago
parent
commit
e49c4f5021
1 changed files with 5 additions and 2 deletions
  1. 5 2
      common/thorhelper/roxiehelper.cpp

+ 5 - 2
common/thorhelper/roxiehelper.cpp

@@ -893,8 +893,11 @@ void FlushingStringBuffer::flushXML(StringBuffer &current, bool isClosing)
                 queued.append(s.detach());
                 s.ensureCapacity(HTTP_SPLIT_RESERVE);
             }
-            lengths.append(current.length());
-            queued.append(current.detach());
+            if (current.length())
+            {
+                lengths.append(current.length());
+                queued.append(current.detach());
+            }
             if (!isClosing)
                 current.ensureCapacity(HTTP_SPLIT_RESERVE);
         }