forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove HpackDecoder.maxHeaderListSizeGoAway (netty#7911)
Motivation: When a sender sends too large of headers it should not unnecessarily kill the connection, as killing the connection is a heavy-handed solution while SETTINGS_MAX_HEADER_LIST_SIZE is advisory and may be ignored. The maxHeaderListSizeGoAway limit in HpackDecoder is unnecessary because any headers causing the list to exceeding the max size can simply be thrown away. In addition, DefaultHttp2FrameReader.HeadersBlockBuilder limits the entire block to maxHeaderListSizeGoAway. Thus individual literals are limited to maxHeaderListSizeGoAway. (Technically, literals are limited to 1.6x maxHeaderListSizeGoAway, since the canonical Huffman code has a maximum compression ratio of .625. However, the "unnecessary" limit in HpackDecoder was also being applied to compressed sizes.) Modifications: Remove maxHeaderListSizeGoAway checking in HpackDecoder and instead eagerly throw away any headers causing the list to exceed maxHeaderListSize. Result: Fewer large header cases will trigger connection-killing. DefaultHttp2FrameReader.HeadersBlockBuilder will still kill the connection when maxHeaderListSizeGoAway is exceeded, however. Fixes netty#7887
- Loading branch information
1 parent
987c443
commit 88f0586
Showing
4 changed files
with
91 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters