Skip to content

Commit

Permalink
Merge branch 'main' into fix-delay-initial-drop
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert authored Sep 26, 2024
2 parents eb0bb75 + 55e3a93 commit 3c42d4b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions neqo-transport/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,7 +2018,10 @@ impl Connection {
// Count how many bytes in this range are non-zero.
let pn_len = mem::size_of::<PacketNumber>()
- usize::try_from(unacked_range.leading_zeros() / 8).unwrap();
// pn_len can't be zero (unacked_range is > 0)
assert!(
pn_len > 0,
"pn_len can't be zero as unacked_range should be > 0, pn {pn}, largest_acknowledged {largest_acknowledged:?}, tx {tx}"
);
// TODO(mt) also use `4*path CWND/path MTU` to set a minimum length.
builder.pn(pn, pn_len);
pn
Expand Down Expand Up @@ -3422,7 +3425,7 @@ impl Connection {
};
let path = self.paths.primary().ok_or(Error::NotAvailable)?;
let mtu = path.borrow().plpmtu();
let encoder = Encoder::with_capacity(mtu);
let encoder = Encoder::default();

let (_, mut builder) = Self::build_packet_header(
&path.borrow(),
Expand Down

0 comments on commit 3c42d4b

Please sign in to comment.