1
0
mirror of synced 2025-04-26 14:28:51 +03:00
This commit is contained in:
yhirose 2017-06-28 19:48:26 -04:00
parent 7cdf62dd31
commit 6d01712fc7

View File

@ -509,9 +509,14 @@ bool read_content(Stream& strm, T& x)
auto len = get_header_value_int(x.headers, "Content-Length", 0);
if (len) {
x.body.assign(len, 0);
if (!strm.read(&x.body[0], x.body.size())) {
auto r = 0;
while (r < len){
auto r_incr = strm.read(&x.body[r], len - r);
if (r_incr <= 0) {
return false;
}
r += r_incr;
}
}
return true;
}