fix: close connection when header size is way too large#915
Merged
Conversation
|
Nice! So, keep going after the limit until it becomes an annoyance and then close the connection. I'll close my PR in favor of this one. I've confirmed that it solves the problem in my case. |
|
@seanmonstar Thank you for merging! Is it possible to know the target date when that change be available in the published |
Member
Author
|
I was aiming for next Monday to do a release. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inspired by the problem highlighted in #912, this will now close a connection if decoded headers are "way" too large.
HPACK requires that we keep decoding no matter what. If a set of headers are larger than the configured limit, we stop saving them, mark them oversize, and then send a RST_STREAM about it. But we keep decoding, because the HPACK table is connection-level state.
The size of the table is bounded, so old entries keep getting evicted. That is fine. But it can mean a lot of CPU usage to ignore them.
This PR says
max_header_list_size * 4is way too big. You go away if you send something way too big.cc @IgorBelyi this is kind of what I had in mind.