From 70c39737db18619a9ac37264ab0f9187871e7907 Mon Sep 17 00:00:00 2001 From: Zak Date: Fri, 17 Jan 2020 20:21:49 +0200 Subject: Disconnect while downloading Previously if a disconnect occured while downloading a non recoverable error was displayed. This PR attempts to fix this by making sure `request_completed` signal is emitted with an `STATUS_CONNECTION_ERROR` response code. --- scene/main/http_request.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 3c89069816..e89000f21b 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -349,6 +349,8 @@ bool HTTPRequest::_update_connection() { } client->poll(); + if (client->get_status() != HTTPClient::STATUS_BODY) + break; // State changed after this poll, will check at next iteration. PoolByteArray chunk = client->read_response_body_chunk(); downloaded += chunk.size(); -- cgit v1.2.3