Merge pull request #35246 from zaksnet/disconnect-while-downloading

Disconnect while downloading
This commit is contained in:
Fabio Alessandrelli 2021-03-02 12:42:52 +01:00 committed by GitHub
commit 9dd28a2953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -387,6 +387,9 @@ bool HTTPRequest::_update_connection() {
} }
client->poll(); client->poll();
if (client->get_status() != HTTPClient::STATUS_BODY) {
return false;
}
PackedByteArray chunk = client->read_response_body_chunk(); PackedByteArray chunk = client->read_response_body_chunk();
downloaded.add(chunk.size()); downloaded.add(chunk.size());