-
-
Notifications
You must be signed in to change notification settings - Fork 452
Closed
Description
While working on #1000, I realized that we are not deduplicating already inserted duplicates when entering unordered mode:
quinn/quinn-proto/src/connection/assembler.rs
Lines 32 to 38 in 2a8c93b
// Enter unordered mode | |
let mut recvd = RangeSet::new(); | |
recvd.insert(0..self.bytes_read); | |
for chunk in &self.data { | |
recvd.insert(chunk.offset..chunk.offset + chunk.bytes.len() as u64); | |
} | |
self.state = State::Unordered { recvd }; |
With that behavior, the following test will fail:
#[test]
fn read_unordered() {
let mut x = Assembler::new();
x.insert(0, Bytes::from_static(b"abc"), 3);
x.insert(0, Bytes::from_static(b"abc"), 3);
x.ensure_ordering(false).unwrap();
assert_eq!(
x.read(3, false),
Some(Chunk::new(0, Bytes::from_static(b"abc")))
);
assert_eq!(x.read(3, false), None);
}
Is this intentional?
Metadata
Metadata
Assignees
Labels
No labels