Skip to content

Commit

Permalink
Break linkability on client-side after planned migration
Browse files Browse the repository at this point in the history
(See bug quinn-rs#1803 for the server-side case.)
  • Loading branch information
nemethf committed Apr 3, 2024
1 parent 4822fd4 commit 523c7d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion quinn-proto/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@ impl Connection {
}

/// Switch to a previously unused remote connection ID, if possible
fn update_rem_cid(&mut self) {
pub fn update_rem_cid(&mut self) {
let (reset_token, retired) = match self.rem_cids.next() {
Some(x) => x,
None => return,
Expand Down
3 changes: 2 additions & 1 deletion quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,8 @@ impl State {
) -> Result<(), ConnectionError> {
loop {
match self.conn_events.poll_recv(cx) {
Poll::Ready(Some(ConnectionEvent::Ping)) => {
Poll::Ready(Some(ConnectionEvent::LocalAddressChanged)) => {
self.inner.update_rem_cid();
self.inner.ping();
}
Poll::Ready(Some(ConnectionEvent::Proto(event))) => {
Expand Down
2 changes: 1 addition & 1 deletion quinn/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl Endpoint {
// Generate some activity so peers notice the rebind
for sender in inner.connections.senders.values() {
// Ignoring errors from dropped connections
let _ = sender.send(ConnectionEvent::Ping);
let _ = sender.send(ConnectionEvent::LocalAddressChanged);
}

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion quinn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ enum ConnectionEvent {
error_code: VarInt,
reason: bytes::Bytes,
},
LocalAddressChanged,
Proto(proto::ConnectionEvent),
Ping,
}

#[derive(Debug)]
Expand Down

0 comments on commit 523c7d9

Please sign in to comment.