Repository navigation
Add the responseBufferSize attribute to the HTTP/1.1 connectors - #1169
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
Allow the size of the response buffer to be configured on the connector. The minimum is 1024 bytes, since a smaller buffer may not hold the encoded form of a multi-byte character. Also fix an int overflow in OutputBuffer.recycle() for buffer sizes of 128 MiB or more when the buffer is compared with 16 times the default.
arturobernalg
force-pushed
the
response-buffer-size
branch
from
November 14, 2026 07:05
966099d to
a987530
Compare
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.
Adds a
responseBufferSizeattribute to the HTTP/1.1 connector. The default stays 8192 bytes, so nothing changes unless it is set. The attribute is also used for HTTP/2, which shares the connector. AJP keeps its packet based size.The value must be at least 1024. A buffer smaller than 4 bytes cannot hold a UTF-8 character, so this leaves a wide margin.
OutputBuffer.recycle()compared the buffer capacity with16 * defaultBufferSizeas an int, which overflows for sizes of 128 MiB or more. It now uses a long.Tests:
TestAbstractHttp11ProtocolResponseBufferSize,TestResponseBufferSize. Also run against a running Tomcat with 1024, 16384 and 65536, HTTP/1.1 and HTTP/2, comparing bytes with main.