mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Don't fail chunked read if buffer not yet filled
This commit is contained in:
parent
956faae6f0
commit
889041f05f
2 changed files with 37 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue