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
1908e3fe9e
commit
39cdd57114
|
@ -491,7 +491,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:")) {
|
||||
|
|
|
@ -174,8 +174,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 New Issue