Fixed #6
This commit is contained in:
parent
7cdf62dd31
commit
6d01712fc7
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user