add missed connection close actions

This commit is contained in:
yggverse 2024-11-30 05:15:44 +02:00
parent 3052d03655
commit 366b5b89ca

View File

@ -633,6 +633,9 @@ impl Page {
); );
}, },
_ => { _ => {
// Close connection
response.connection.close();
// Define common data // Define common data
let status = Status::Failure; let status = Status::Failure;
let title = "Oops"; let title = "Oops";
@ -657,6 +660,9 @@ impl Page {
gemini::client::response::meta::Status::Redirect | gemini::client::response::meta::Status::Redirect |
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-31-permanent-redirection // https://geminiprotocol.net/docs/protocol-specification.gmi#status-31-permanent-redirection
gemini::client::response::meta::Status::PermanentRedirect => { gemini::client::response::meta::Status::PermanentRedirect => {
// Close connection
response.connection.close();
// Extract redirection URL from response data // Extract redirection URL from response data
match response.meta.data { match response.meta.data {
Some(unresolved_url) => { Some(unresolved_url) => {
@ -770,6 +776,9 @@ impl Page {
gemini::client::response::meta::Status::CertificateUnauthorized | gemini::client::response::meta::Status::CertificateUnauthorized |
// https://geminiprotocol.net/docs/protocol-specification.gmi#status-62-certificate-not-valid // https://geminiprotocol.net/docs/protocol-specification.gmi#status-62-certificate-not-valid
gemini::client::response::meta::Status::CertificateInvalid => { gemini::client::response::meta::Status::CertificateInvalid => {
// Close connection
response.connection.close();
// Define common data // Define common data
let status = Status::Success; let status = Status::Success;
let title = "Identity"; let title = "Identity";
@ -800,6 +809,9 @@ impl Page {
update.activate(Some(&id)); update.activate(Some(&id));
} }
_ => { _ => {
// Close connection
response.connection.close();
// Define common data // Define common data
let status = Status::Failure; let status = Status::Failure;
let title = "Oops"; let title = "Oops";