소스 검색

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 년 전
부모
커밋
e49c4f5021
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  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);
         }