Fix http limitation for large "content-length"
When a request was issued to a server that returned "content-length" header
whose value was greater than that of an "int" we ran into overflow
problems. The fix for this was rather simple by increasing the data
type to `int64_t`
(cherry picked from commit 69a532414c
)
This commit is contained in:
parent
ea637f641e
commit
e3292633be
2 changed files with 3 additions and 3 deletions
|
@ -555,7 +555,7 @@ Error HTTPClient::poll() {
|
|||
continue;
|
||||
}
|
||||
if (s.begins_with("content-length:")) {
|
||||
body_size = s.substr(s.find(":") + 1, s.length()).strip_edges().to_int();
|
||||
body_size = s.substr(s.find(":") + 1, s.length()).strip_edges().to_int64();
|
||||
body_left = body_size;
|
||||
|
||||
} else if (s.begins_with("transfer-encoding:")) {
|
||||
|
|
|
@ -180,8 +180,8 @@ private:
|
|||
Vector<uint8_t> chunk;
|
||||
int chunk_left;
|
||||
bool chunk_trailer_part;
|
||||
int body_size;
|
||||
int body_left;
|
||||
int64_t body_size;
|
||||
int64_t body_left;
|
||||
bool read_until_eof;
|
||||
|
||||
Ref<StreamPeerTCP> tcp_connection;
|
||||
|
|
Loading…
Reference in a new issue