Skip to content

Add the responseBufferSize attribute to the HTTP/1.1 connectors - #1169

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:response-buffer-size
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:response-buffer-size

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

Adds a responseBufferSize attribute 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 with 16 * defaultBufferSize as 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant