瀏覽代碼

[Net] Fix get_response_body_length for large files.

Parsing was fixed, but not the return value for the exposed getter.

(cherry picked from commit 01e5e98312389f09320f72b34e7be4f5f39f19da)
Fabio Alessandrelli 3 年之前
父節點
當前提交
822da984bb
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      core/io/http_client.cpp
  2. 1 1
      core/io/http_client.h
  3. 1 1
      platform/javascript/http_client_javascript.cpp

+ 1 - 1
core/io/http_client.cpp

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

+ 1 - 1
core/io/http_client.h

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

+ 1 - 1
platform/javascript/http_client_javascript.cpp

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