HTTPRequest: Improve response when disconnecting 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.
(cherry picked from commit 70c39737db
)
This commit is contained in:
parent
1134fade46
commit
3f36ca7323
1 changed files with 3 additions and 0 deletions
|
@ -347,6 +347,9 @@ bool HTTPRequest::_update_connection() {
|
|||
}
|
||||
|
||||
client->poll();
|
||||
if (client->get_status() != HTTPClient::STATUS_BODY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
PoolByteArray chunk = client->read_response_body_chunk();
|
||||
downloaded.add(chunk.size());
|
||||
|
|
Loading…
Reference in a new issue