Skip to content

Commit

Permalink
Fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Apr 17, 2024
1 parent bbe0cf5 commit 6f41da8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions neqo-transport/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,12 @@ impl Connection {
if !init_token.is_empty() {
self.address_validation = AddressValidationInfo::NewToken(init_token.to_vec());
}
self.paths.primary().ok_or(Error::InternalError)?.borrow_mut().rtt_mut().set_initial(rtt);
self.paths
.primary()
.ok_or(Error::InternalError)?
.borrow_mut()
.rtt_mut()
.set_initial(rtt);
self.set_initial_limits();
// Start up TLS, which has the effect of setting up all the necessary
// state for 0-RTT. This only stages the CRYPTO frames.
Expand Down Expand Up @@ -1747,7 +1752,6 @@ impl Connection {
}

let path = self.paths.primary().ok_or(Error::InvalidMigration)?;

let local = local.unwrap_or_else(|| path.borrow().local_address());
let remote = remote.unwrap_or_else(|| path.borrow().remote_address());

Expand Down Expand Up @@ -1802,8 +1806,12 @@ impl Connection {
// has to use the existing address. So only pay attention to a preferred
// address from the same family as is currently in use. More thought will
// be needed to work out how to get addresses from a different family.
let path = self.paths.primary().ok_or(Error::NoAvailablePath)?;
let prev = path.borrow().remote_address();
let prev = self
.paths
.primary()
.ok_or(Error::NoAvailablePath)?
.borrow()
.remote_address();
let remote = match prev.ip() {
IpAddr::V4(_) => addr.ipv4().map(SocketAddr::V4),
IpAddr::V6(_) => addr.ipv6().map(SocketAddr::V6),
Expand Down

0 comments on commit 6f41da8

Please sign in to comment.