summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-03-02 12:42:52 +0100
committerGitHub <noreply@github.com>2021-03-02 12:42:52 +0100
commit9dd28a2953e1af1e2250d3d8401bc9d42a397869 (patch)
tree3e9ac019c877f6c2561f410147f54393d93c3845
parent0862b2926076790fb771e2d8322ea254e972c285 (diff)
parentbc8fe786b2fa4ad4bfb10daeb9bfe38eddfc2496 (diff)
Merge pull request #35246 from zaksnet/disconnect-while-downloading
Disconnect while downloading
-rw-r--r--scene/main/http_request.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp
index 77bdf09426..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());