From 69d9196b4ce353f4d85459e6b648da1dde65da08 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 1 Dec 2023 10:51:59 +0100 Subject: [PATCH] =?UTF-8?q?QPACK:=20Handle=20it=20as=20an=20error=20if=20w?= =?UTF-8?q?e=20receive=20an=20ack=20for=20a=20section=20for=20w=E2=80=A6?= =?UTF-8?q?=20(#268)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …hich we have no indices. Motivation: We should treat it as an error if we receive an ack for a section for which we have no indices. Modifications: Throw exception if we receive an ack for a section that has no indices Result: Correctly handle acks --- .../java/io/netty/incubator/codec/http3/QpackEncoder.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java b/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java index f3cc179..65df0d8 100644 --- a/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java +++ b/src/main/java/io/netty/incubator/codec/http3/QpackEncoder.java @@ -151,9 +151,12 @@ void sectionAcknowledgment(long streamId) throws QpackException { if (tracker.isEmpty()) { streamSectionTrackers.remove(streamId); } - if (dynamicTableIndices != null) { - dynamicTableIndices.forEach(dynamicTable::acknowledgeInsertCount); + + if (dynamicTableIndices == null) { + throw INVALID_SECTION_ACKNOWLEDGMENT; } + + dynamicTableIndices.forEach(dynamicTable::acknowledgeInsertCount); } /**