Skip to content

Commit

Permalink
bug fix add connection when created first time
Browse files Browse the repository at this point in the history
  • Loading branch information
godmodegalactus committed Sep 14, 2023
1 parent b8437c0 commit f75c665
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions core/src/quic_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
}
}

Expand Down

0 comments on commit f75c665

Please sign in to comment.