UNDERTOW-2017: HttpRequestConduit state is correctly maintained #1288
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.
Previously, small buffers that required multiple events to write
would not save the correct header state, resulting in NPEs
and requests which failed to include all headers.
This PR removes the duplicated state between the method body
and HttpRequestConduit in favor of exclusively using
HttpRequestConduit fields. This way the behavior across state
changes is unlikely to be impacted at all.
Hotspot isn't able to optimize field access quite as well
as local method scoped variables, however this isn't likely
to have an impact in practice, and it's more important to
send all headers with every request.