bug fix add connection when created first time

This commit is contained in:
Godmode Galactus 2023-09-14 15:09:35 +02:00
parent 3e4c6ed933
commit 41d36a8e3b
No known key found for this signature in database
GPG Key ID: A04142C71ABB0DEA
1 changed files with 6 additions and 11 deletions

View File

@ -79,16 +79,7 @@ impl QuicConnection {
if connection.stable_id() != current_stable_id {
Some(connection)
} else {
let new_conn = QuicConnectionUtils::connect(
self.identity,
true,
self.endpoint.clone(),
self.socket_address,
self.connection_params.connection_timeout,
self.connection_params.connection_retry_count,
self.exit_signal.clone(),
)
.await;
let new_conn = self.connect().await;
if let Some(new_conn) = new_conn {
*conn = Some(new_conn);
conn.clone()
@ -101,7 +92,11 @@ impl QuicConnection {
Some(connection.clone())
}
}
None => self.connect().await,
None => {
let connection = self.connect().await;
*self.connection.write().await = connection.clone();
connection
}
}
}