From 05367c755c4b4745f521f97fb2e71dd6a521d644 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 27 Feb 2021 21:46:27 +0100 Subject: [PATCH] [Net] Better EOF handling in HTTPRequest. This fix request_completed being emitted two times, the first with the result, the second as a failure when retrieving responses served with read-until-EOF. (cherry picked from commit d61cd469f105d269d66c286bb1efd304a5abb0a5) --- scene/main/http_request.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 2e62b58efe9..8a5ccce375b 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -376,6 +376,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;