diff options
Diffstat (limited to 'scene/main/http_request.cpp')
-rw-r--r-- | scene/main/http_request.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index ce7d6ef13c..71c372aec2 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -387,6 +387,9 @@ bool HTTPRequest::_update_connection() { } client->poll(); + if (client->get_status() != HTTPClient::STATUS_BODY) { + return false; + } PackedByteArray chunk = client->read_response_body_chunk(); downloaded.add(chunk.size()); @@ -415,6 +418,7 @@ bool HTTPRequest::_update_connection() { } else if (client->get_status() == HTTPClient::STATUS_DISCONNECTED) { // We read till EOF, with no errors. Request is done. call_deferred("_request_done", RESULT_SUCCESS, response_code, response_headers, body); + return true; } return false; |