mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
remove deprecated event listener
This commit is contained in:
parent
1a8bd44841
commit
4c0fea0e99
1 changed files with 2 additions and 20 deletions
|
|
@ -7,12 +7,8 @@ pub mod error;
|
||||||
pub use connection::Connection;
|
pub use connection::Connection;
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
|
|
||||||
use gio::{
|
use gio::{prelude::SocketClientExt, Cancellable, SocketClient, SocketProtocol, TlsCertificate};
|
||||||
prelude::{SocketClientExt, TlsConnectionExt},
|
use glib::{Priority, Uri};
|
||||||
Cancellable, SocketClient, SocketClientEvent, SocketProtocol, TlsCertificate,
|
|
||||||
TlsClientConnection,
|
|
||||||
};
|
|
||||||
use glib::{object::Cast, Priority, Uri};
|
|
||||||
|
|
||||||
pub const DEFAULT_TIMEOUT: u32 = 10;
|
pub const DEFAULT_TIMEOUT: u32 = 10;
|
||||||
|
|
||||||
|
|
@ -42,20 +38,6 @@ impl Client {
|
||||||
socket.set_protocol(SocketProtocol::Tcp);
|
socket.set_protocol(SocketProtocol::Tcp);
|
||||||
socket.set_timeout(DEFAULT_TIMEOUT);
|
socket.set_timeout(DEFAULT_TIMEOUT);
|
||||||
|
|
||||||
// Connect events
|
|
||||||
socket.connect_event(|_, event, _, stream| {
|
|
||||||
// Condition applicable only for guest TLS connections
|
|
||||||
// * for user certificates validation, see `new_tls_client_connection`
|
|
||||||
if event == SocketClientEvent::TlsHandshaking {
|
|
||||||
// Begin guest certificate validation
|
|
||||||
stream
|
|
||||||
.unwrap()
|
|
||||||
.dynamic_cast_ref::<TlsClientConnection>()
|
|
||||||
.unwrap()
|
|
||||||
.connect_accept_certificate(|_, _, _| true); // @TODO
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
Self { socket }
|
Self { socket }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue