summaryrefslogtreecommitdiff
path: root/scene/main/http_request.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r--scene/main/http_request.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index 8b68b3215c..88b942ee45 100644
--- a/scene/main/http_request.cpp
+++ b/scene/main/http_request.cpp
@@ -286,7 +286,7 @@ bool HTTPRequest::_update_connection() {
call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, PoolByteArray());
return true;
}
- if (got_response && body_len < 0) {
+ if (body_len < 0) {
// Chunked transfer is done
call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, body);
return true;
@@ -425,7 +425,7 @@ void HTTPRequest::_notification(int p_what) {
void HTTPRequest::set_use_threads(bool p_use) {
- ERR_FAIL_COND(status != HTTPClient::STATUS_DISCONNECTED);
+ ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED);
use_threads = p_use;
}
@@ -436,7 +436,7 @@ bool HTTPRequest::is_using_threads() const {
void HTTPRequest::set_body_size_limit(int p_bytes) {
- ERR_FAIL_COND(status != HTTPClient::STATUS_DISCONNECTED);
+ ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED);
body_size_limit = p_bytes;
}
@@ -448,7 +448,7 @@ int HTTPRequest::get_body_size_limit() const {
void HTTPRequest::set_download_file(const String &p_file) {
- ERR_FAIL_COND(status != HTTPClient::STATUS_DISCONNECTED);
+ ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED);
download_to_file = p_file;
}
@@ -546,7 +546,6 @@ HTTPRequest::HTTPRequest() {
downloaded = 0;
body_size_limit = -1;
file = NULL;
- status = HTTPClient::STATUS_DISCONNECTED;
}
HTTPRequest::~HTTPRequest() {