Reject a renumbered multipart total and check abort before the send window

This commit is contained in:
2026-08-27 12:43:17 +02:00
parent 8a182604b7
commit ff3667e120
5 changed files with 63 additions and 2 deletions
+11
View File
@@ -365,6 +365,17 @@ describe('reassembly bounds', () => {
assert.equal(reassembler.size, 0);
});
// Parts 1/2 then 2/3 would otherwise complete the stored two-part group, truncating the message.
test('refuses a segment that renumbers how many parts the message has', () => {
const reassembler = new Reassembler({ log: silentLog, max: 10, now: () => 0, timeout: 60_000 });
assert.equal(collect(reassembler, 9, 1, 2), undefined);
assert.equal(collect(reassembler, 9, 2, 3), undefined);
assert.equal(reassembler.size, 1);
reassembler.clear();
});
// 0.4.0 held incomplete groups without limit and swept them only when other traffic arrived.
test('drops the oldest incomplete message once the cap is reached', () => {
const reassembler = new Reassembler({ log: silentLog, max: 2, now: () => 0, timeout: 60_000 });