瀏覽代碼

Merge pull request #5111 from wangkx/h10301

HPCC-10301 Read enough data for mime header process when uploading files

Reviewed-By: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 11 年之前
父節點
當前提交
c3f0e15a93
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      esp/bindings/http/platform/httptransport.cpp

+ 3 - 1
esp/bindings/http/platform/httptransport.cpp

@@ -1848,7 +1848,9 @@ bool CHttpRequest::readContentToBuffer(MemoryBuffer& buffer, __int64& bytesNotRe
 
 bool CHttpRequest::readUploadFileName(CMimeMultiPart* mimemultipart, StringBuffer& fileName, MemoryBuffer& contentBuffer, __int64& bytesNotRead)
 {
-    if (contentBuffer.length())
+    //Make sure that contentBuffer contains all of the mime headers for a file. The readUploadFileName() retrieves
+    //the file name from those headers and moves a data pointer to the end of those headers.
+    if ((bytesNotRead < 1) || (contentBuffer.length() > 512))
         mimemultipart->readUploadFileName(contentBuffer, fileName);
 
     while((fileName.length() < 1) && (bytesNotRead > 0))