Fix #10805 zero dynamic table (#11445) (#11452)

* Fix #10805 zero dynamic table (#11445)

* Added test for #10805 Zero Dynamic Table

* fixed file header

* Added test for #10805 Zero Dynamic Table

* Fix for #10805 Zero Dynamic Table

Set the correct default size for the table.
Always send the max table size on the first encode

* updated file header

Signed-off-by: gregw <gregw@webtide.com>

---------

Signed-off-by: gregw <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2024-02-28 12:14:33 +01:00 committed by gregw
parent 1bba3cd41e
commit 686dd88c3a
1 changed files with 6 additions and 2 deletions

View File

@ -99,10 +99,11 @@ public class HpackEncoder
private int _maxHeaderListSize;
private int _headerListSize;
private boolean _validateEncoding = true;
private boolean _maxDynamicTableSizeSent = false;
public HpackEncoder()
{
_context = new HpackContext(0);
_context = new HpackContext(HpackContext.DEFAULT_MAX_TABLE_CAPACITY);
_debug = LOG.isDebugEnabled();
setMaxTableCapacity(HpackContext.DEFAULT_MAX_TABLE_CAPACITY);
setTableCapacity(HpackContext.DEFAULT_MAX_TABLE_CAPACITY);
@ -197,8 +198,11 @@ public class HpackEncoder
// If max table size changed, send the correspondent instruction.
int tableCapacity = getTableCapacity();
if (tableCapacity != _context.getMaxDynamicTableSize())
if (!_maxDynamicTableSizeSent || tableCapacity != _context.getMaxDynamicTableSize())
{
_maxDynamicTableSizeSent = true;
encodeMaxDynamicTableSize(buffer, tableCapacity);
}
// Add Request/response meta fields
if (metadata.isRequest())