mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-02 10:05:36 +00:00
reorder actions, add comments
This commit is contained in:
parent
a06e4e9eff
commit
873489df29
1 changed files with 12 additions and 7 deletions
|
|
@ -65,6 +65,16 @@ impl Connection {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Request force handshake for `Self` connection
|
||||||
|
/// * useful for certificate change in runtime
|
||||||
|
pub fn rehandshake(&self) -> Result<(), Error> {
|
||||||
|
match self.tls_client_connection()?.handshake(Cancellable::NONE) {
|
||||||
|
// @TODO shared `Cancellable`
|
||||||
|
Ok(()) => Ok(()),
|
||||||
|
Err(e) => Err(Error::Rehandshake(e)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Getters
|
// Getters
|
||||||
|
|
||||||
/// Upcast [IOStream](https://docs.gtk.org/gio/class.IOStream.html)
|
/// Upcast [IOStream](https://docs.gtk.org/gio/class.IOStream.html)
|
||||||
|
|
@ -78,6 +88,8 @@ impl Connection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get [TlsClientConnection](https://docs.gtk.org/gio/iface.TlsClientConnection.html) for `Self`
|
||||||
|
/// * compatible with user and guest sessions
|
||||||
pub fn tls_client_connection(&self) -> Result<TlsClientConnection, Error> {
|
pub fn tls_client_connection(&self) -> Result<TlsClientConnection, Error> {
|
||||||
match self.tls_client_connection.clone() {
|
match self.tls_client_connection.clone() {
|
||||||
// User session
|
// User session
|
||||||
|
|
@ -95,13 +107,6 @@ impl Connection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn rehandshake(&self) -> Result<(), Error> {
|
|
||||||
match self.tls_client_connection()?.handshake(Cancellable::NONE) {
|
|
||||||
Ok(()) => Ok(()),
|
|
||||||
Err(e) => Err(Error::Rehandshake(e)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue