From 366b5b89ca82cc0225d156477dc3a3bfbf89b448 Mon Sep 17 00:00:00 2001 From: yggverse Date: Sat, 30 Nov 2024 05:15:44 +0200 Subject: [PATCH] add missed connection close actions --- src/app/browser/window/tab/item/page.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/browser/window/tab/item/page.rs b/src/app/browser/window/tab/item/page.rs index f3661b38..7b80175e 100644 --- a/src/app/browser/window/tab/item/page.rs +++ b/src/app/browser/window/tab/item/page.rs @@ -633,6 +633,9 @@ impl Page { ); }, _ => { + // Close connection + response.connection.close(); + // Define common data let status = Status::Failure; let title = "Oops"; @@ -657,6 +660,9 @@ impl Page { gemini::client::response::meta::Status::Redirect | // https://geminiprotocol.net/docs/protocol-specification.gmi#status-31-permanent-redirection gemini::client::response::meta::Status::PermanentRedirect => { + // Close connection + response.connection.close(); + // Extract redirection URL from response data match response.meta.data { Some(unresolved_url) => { @@ -770,6 +776,9 @@ impl Page { gemini::client::response::meta::Status::CertificateUnauthorized | // https://geminiprotocol.net/docs/protocol-specification.gmi#status-62-certificate-not-valid gemini::client::response::meta::Status::CertificateInvalid => { + // Close connection + response.connection.close(); + // Define common data let status = Status::Success; let title = "Identity"; @@ -800,6 +809,9 @@ impl Page { update.activate(Some(&id)); } _ => { + // Close connection + response.connection.close(); + // Define common data let status = Status::Failure; let title = "Oops";