From 1aa1f42963a2b98040e2fdd74e174458710dcafb Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 16 Feb 2019 16:01:20 +0100 Subject: [PATCH 1/2] Fix uninitialized value --- editor/plugins/asset_library_editor_plugin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index c68023ee9b0..ab3936407b6 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1338,6 +1338,7 @@ void EditorAssetLibrary::_bind_methods() { EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { + requesting = REQUESTING_NONE; templates_only = p_templates_only; VBoxContainer *library_main = memnew(VBoxContainer); From 673caa5f462e4f89ffae65b111a9817d29467277 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Sat, 16 Feb 2019 17:05:13 +0100 Subject: [PATCH 2/2] Fix keep-alive without header in HTTP client --- core/io/http_client.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index b3fd814870e..b25b1934ff9 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -426,11 +426,10 @@ Error HTTPClient::poll() { response_headers.clear(); response_num = RESPONSE_OK; - // Per the HTTP 1.1 spec, keep-alive is the default, but in practice - // it's safe to assume it only if the explicit header is found, allowing - // to handle body-up-to-EOF responses on naive servers; that's what Curl - // and browsers do - bool keep_alive = false; + // Per the HTTP 1.1 spec, keep-alive is the default. + // Not following that specification breaks standard implemetations. + // Broken web servers should be fixed. + bool keep_alive = true; for (int i = 0; i < responses.size(); i++) { @@ -447,8 +446,8 @@ Error HTTPClient::poll() { if (encoding == "chunked") { chunked = true; } - } else if (s.begins_with("connection: keep-alive")) { - keep_alive = true; + } else if (s.begins_with("connection: close")) { + keep_alive = false; } if (i == 0 && responses[i].begins_with("HTTP")) {