Browse Source

Update scene/main/http_request.cpp

Co-authored-by: Rémi Verschelde <[email protected]>
Zak Stam 4 years ago
parent
commit
bc8fe786b2
1 changed files with 3 additions and 2 deletions
  1. 3 2
      scene/main/http_request.cpp

+ 3 - 2
scene/main/http_request.cpp

@@ -349,8 +349,9 @@ bool HTTPRequest::_update_connection() {
 			}
 
 			client->poll();
-			if (client->get_status() != HTTPClient::STATUS_BODY)
-				break; // State changed after this poll, will check at next iteration.
+			if (client->get_status() != HTTPClient::STATUS_BODY) {
+				return false;
+			}
 
 			PoolByteArray chunk = client->read_response_body_chunk();
 			downloaded += chunk.size();