[Net] Fix get_response_body_length for large files.

Parsing was fixed, but not the return value for the exposed getter.
This commit is contained in:
Fabio Alessandrelli 2022-01-23 01:28:35 +01:00
parent e363f404a5
commit 01e5e98312
5 changed files with 5 additions and 5 deletions

View File

@ -180,7 +180,7 @@ public:
virtual bool is_response_chunked() const = 0;
virtual int get_response_code() const = 0;
virtual Error get_response_headers(List<String> *r_response) = 0;
virtual int get_response_body_length() const = 0;
virtual int64_t get_response_body_length() const = 0;
virtual PackedByteArray read_response_body_chunk() = 0; // Can't get body as partial text because of most encodings UTF8, gzip, etc.

View File

@ -534,7 +534,7 @@ Error HTTPClientTCP::poll() {
return OK;
}
int HTTPClientTCP::get_response_body_length() const {
int64_t HTTPClientTCP::get_response_body_length() const {
return body_size;
}

View File

@ -87,7 +87,7 @@ public:
bool is_response_chunked() const override;
int get_response_code() const override;
Error get_response_headers(List<String> *r_response) override;
int get_response_body_length() const override;
int64_t get_response_body_length() const override;
PackedByteArray read_response_body_chunk() override;
void set_blocking_mode(bool p_enable) override;
bool is_blocking_mode_enabled() const override;

View File

@ -143,7 +143,7 @@ Error HTTPClientJavaScript::get_response_headers(List<String> *r_response) {
return OK;
}
int HTTPClientJavaScript::get_response_body_length() const {
int64_t HTTPClientJavaScript::get_response_body_length() const {
return godot_js_fetch_body_length_get(js_id);
}

View File

@ -95,7 +95,7 @@ public:
bool is_response_chunked() const override;
int get_response_code() const override;
Error get_response_headers(List<String> *r_response) override;
int get_response_body_length() const override;
int64_t get_response_body_length() const override;
PackedByteArray read_response_body_chunk() override;
void set_blocking_mode(bool p_enable) override;
bool is_blocking_mode_enabled() const override;