mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
handle SocketConnection close errors, remove deprecated implementation
This commit is contained in:
parent
79f219ba76
commit
6ee60e9d9d
1 changed files with 3 additions and 15 deletions
|
|
@ -51,24 +51,12 @@ impl Connection {
|
|||
// Actions
|
||||
|
||||
/// Close owned [SocketConnection](https://docs.gtk.org/gio/class.SocketConnection.html)
|
||||
/// and [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html) if active
|
||||
pub fn close(&self) -> Result<(), Error> {
|
||||
/* Do not close `TlsClientConnection` as wanted for re-handshake
|
||||
on user certificate change in runtime! @TODO
|
||||
if let Some(ref tls_client_connection) = self.tls_client_connection {
|
||||
if !tls_client_connection.is_closed() {
|
||||
if let Err(e) = tls_client_connection.close(self.cancellable.as_ref()) {
|
||||
return Err(Error::TlsClientConnection(e));
|
||||
match self.socket_connection.close(self.cancellable.as_ref()) {
|
||||
Ok(()) => Ok(()),
|
||||
Err(e) => Err(Error::SocketConnection(e)),
|
||||
}
|
||||
}
|
||||
} */
|
||||
if !self.socket_connection.is_closed() {
|
||||
if let Err(e) = self.socket_connection.close(self.cancellable.as_ref()) {
|
||||
return Err(Error::SocketConnection(e));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Request force handshake for `Self`
|
||||
/// * useful for certificate change in runtime
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue