Skip to content

Commit

Permalink
fully integrated explicit path ID
Browse files Browse the repository at this point in the history
  • Loading branch information
qdeconinck committed Feb 29, 2024
1 parent 9977a07 commit 613c41c
Show file tree
Hide file tree
Showing 6 changed files with 417 additions and 206 deletions.
20 changes: 13 additions & 7 deletions apps/src/bin/quiche-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,20 @@ fn main() {
clients_ids.remove(&retired_scid);
}

// Provides as many CIDs as possible.
while client.conn.scids_left() > 0 {
let (scid, reset_token) = generate_cid_and_reset_token(&rng);
if client.conn.new_scid(&scid, reset_token, false).is_err() {
break;
}
for path_id in client.conn.path_ids() {
// Provides as many CIDs as possible.
while client.conn.scids_left_on_path(path_id) > 0 {
let (scid, reset_token) = generate_cid_and_reset_token(&rng);
if client
.conn
.new_scid_on_path(path_id, &scid, reset_token, false)
.is_err()
{
break;
}

clients_ids.insert(scid, client.client_id);
clients_ids.insert(scid, client.client_id);
}
}
}

Expand Down
17 changes: 11 additions & 6 deletions apps/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,19 @@ pub fn connect(
}

// Provides as many CIDs as possible.
while conn.scids_left() > 0 {
let (scid, reset_token) = generate_cid_and_reset_token(&rng);
for path_id in conn.path_ids() {
while conn.scids_left_on_path(path_id) > 0 {
let (scid, reset_token) = generate_cid_and_reset_token(&rng);

if conn.new_scid(&scid, reset_token, false).is_err() {
break;
}
if conn
.new_scid_on_path(path_id, &scid, reset_token, false)
.is_err()
{
break;
}

scid_sent = true;
scid_sent = true;
}
}

if conn_args.initial_max_paths.is_some() &&
Expand Down
Loading

0 comments on commit 613c41c

Please sign in to comment.