Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP/3 QPACK - do not expect section ack for zero required insert count #7802

Merged
merged 4 commits into from May 15, 2022

Conversation

lachlan-roberts
Copy link
Contributor

https://datatracker.ietf.org/doc/html/draft-ietf-quic-qpack-21#section-4.4.1

After processing an encoded field section whose declared Required
Insert Count is not zero, the decoder emits a Section Acknowledgment
instruction.

If an encoder receives a Section Acknowledgment instruction referring
to a stream on which every encoded field section with a non-zero
Required Insert Count has already been acknowledged, this MUST be
treated as a connection error of type QPACK_DECODER_STREAM_ERROR.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@sbordet sbordet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test case?

@joakime joakime added this to the 10.0.x milestone Apr 7, 2022
{
// Encode a header with only a value contained in the static table.
ByteBuffer buffer = encode(_encoder, 0, toMetaData("GET", "/", "http"));
System.err.println(BufferUtil.toDetailString(buffer));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the System.err..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

// Parsing a section ack instruction on the encoder when we are not expecting it should result in QPACK_DECODER_STREAM_ERROR.
SectionAcknowledgmentInstruction instruction = new SectionAcknowledgmentInstruction(0);
ByteBuffer instructionBuffer = toBuffer(instruction);
QpackException error = assertThrows(QpackException.class, () -> _encoder.parseInstructions(instructionBuffer));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to test for QpackException.StreamException here to be sure it's not a SESSION error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a SessionException and thats what I would expect it to be. The rfc says it must be treated "as a connection error".

I have added this check to the test case.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts lachlan-roberts merged commit 07af5d7 into jetty-10.0.x May 15, 2022
@lachlan-roberts lachlan-roberts deleted the jetty-10.0.x-qpack-sectionAck branch May 15, 2022 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants