1
0
mirror of synced 2025-04-28 09:25:05 +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); auto len = get_header_value_int(x.headers, "Content-Length", 0);
if (len) { if (len) {
x.body.assign(len, 0); 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; return false;
} }
r += r_incr;
}
} }
return true; return true;
} }