mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-03-31 17:15:31 +00:00
get connection ownership on wrap
This commit is contained in:
parent
e437d35acf
commit
1c50fadfde
2 changed files with 11 additions and 8 deletions
|
|
@ -82,9 +82,9 @@ impl Client {
|
|||
move |result| match result {
|
||||
Ok(connection) => {
|
||||
match Connection::new_wrap(
|
||||
&connection,
|
||||
certificate.as_ref(),
|
||||
Some(&network_address),
|
||||
connection,
|
||||
certificate,
|
||||
Some(network_address),
|
||||
) {
|
||||
Ok(result) => request_async(
|
||||
result,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ impl Connection {
|
|||
|
||||
/// Create new `Self`
|
||||
pub fn new_wrap(
|
||||
socket_connection: &SocketConnection,
|
||||
certificate: Option<&TlsCertificate>,
|
||||
server_identity: Option<&NetworkAddress>,
|
||||
socket_connection: SocketConnection,
|
||||
certificate: Option<TlsCertificate>,
|
||||
server_identity: Option<NetworkAddress>,
|
||||
) -> Result<Self, Error> {
|
||||
if socket_connection.is_closed() {
|
||||
return Err(Error::SocketConnectionClosed);
|
||||
|
|
@ -29,8 +29,11 @@ impl Connection {
|
|||
socket_connection: socket_connection.clone(),
|
||||
tls_client_connection: match certificate {
|
||||
Some(certificate) => {
|
||||
match new_tls_client_connection(socket_connection, certificate, server_identity)
|
||||
{
|
||||
match new_tls_client_connection(
|
||||
&socket_connection,
|
||||
&certificate,
|
||||
server_identity.as_ref(),
|
||||
) {
|
||||
Ok(tls_client_connection) => Some(tls_client_connection),
|
||||
Err(reason) => return Err(reason),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue