Merge pull request #51 from sgraham/chunk-terminator
Read \r\n terminator after chunked encoding
This commit is contained in:
commit
4ddd5d9c5c
@ -833,6 +833,12 @@ bool read_content_chunked(Stream& strm, T& x)
|
|||||||
chunk_len = std::stoi(reader.ptr(), 0, 16);
|
chunk_len = std::stoi(reader.ptr(), 0, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chunk_len == 0) {
|
||||||
|
// Reader terminator after chunks
|
||||||
|
if (!reader.getline() || strcmp(reader.ptr(), "\r\n"))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user