Don't fail chunked read if buffer not yet filled

This commit is contained in:
Scott Graham committed 2018-04-17 22:05:38 -07:00
1 parent 956faae6f0
commit 889041f05f
2 files changed
+37 -4

No files matched your search

+2 -4
View File
@@ -817,10 +817,8 @@ bool read_content_chunked(Stream& strm, std::string& out)
auto chunk_len = std::stoi(reader.ptr(), 0, 16);
while (chunk_len > 0){
std::string chunk(chunk_len, 0);
auto n = strm.read(&chunk[0], chunk_len);
if (n <= 0) {
std::string chunk;
if (!read_content_with_length(strm, chunk, chunk_len, nullptr)) {
return false;
}