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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -166,7 +166,8 @@ public boolean decode(long streamId, ByteBuffer buffer, Handler handler) throws
if (LOG.isDebugEnabled())
LOG.debug("Decoded: streamId={}, metadata={}", streamId, metaData);
_metaDataNotifications.add(new MetaDataNotification(streamId, metaData, handler));
_instructions.add(new SectionAcknowledgmentInstruction(streamId));
if (requiredInsertCount > 0)
_instructions.add(new SectionAcknowledgmentInstruction(streamId));
}
else
{
Expand Down Expand Up @@ -236,15 +237,17 @@ private void checkEncodedFieldSections() throws QpackException
int insertCount = _context.getDynamicTable().getInsertCount();
for (EncodedFieldSection encodedFieldSection : _encodedFieldSections)
{
if (encodedFieldSection.getRequiredInsertCount() <= insertCount)
int requiredInsertCount = encodedFieldSection.getRequiredInsertCount();
if (requiredInsertCount <= insertCount)
{
long streamId = encodedFieldSection.getStreamId();
MetaData metaData = encodedFieldSection.decode(_context, _maxHeaderSize);
if (LOG.isDebugEnabled())
LOG.debug("Decoded: streamId={}, metadata={}", streamId, metaData);

_metaDataNotifications.add(new MetaDataNotification(streamId, metaData, encodedFieldSection.getHandler()));
_instructions.add(new SectionAcknowledgmentInstruction(streamId));
if (requiredInsertCount > 0)
_instructions.add(new SectionAcknowledgmentInstruction(streamId));
}
}
}
Expand Down
Expand Up @@ -193,7 +193,15 @@ public void encode(ByteBuffer buffer, long streamId, MetaData metadata) throws Q
requiredInsertCount = entryRequiredInsertCount;
}

// We should not expect section acknowledgements for 0 required insert count.
sectionInfo.setRequiredInsertCount(requiredInsertCount);
if (requiredInsertCount == 0)
{
streamInfo.remove(sectionInfo);
if (streamInfo.isEmpty())
_streamInfoMap.remove(streamId);
}

int base = dynamicTable.getBase();
int encodedInsertCount = encodeInsertCount(requiredInsertCount, dynamicTable.getCapacity());
boolean signBit = base < requiredInsertCount;
Expand Down