fix(http): correct brotli decompressor buffer capacity to 8 KiB - #4228
Draft
Sruhvx-jpg wants to merge 1 commit into
Draft
fix(http): correct brotli decompressor buffer capacity to 8 KiB#4228Sruhvx-jpg wants to merge 1 commit into
Sruhvx-jpg wants to merge 1 commit into
Conversation
Replace the misaligned `8_096` buffer capacity literal in the Brotli decompressor writer initialization with `8 * 1024` (8 KiB) to ensure clean memory page and allocator size-class alignment.
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.
Summary
Fixes the misaligned
8_096buffer capacity typo inactix_http::encoding::Decoderwhen initializing the Brotli decompressor writer, replacing it withDEFAULT_DECODER_CAPACITY = 8 * 1024(8 KiB) to ensure clean virtual memory page and allocator size-class alignment.Context
actix-http/src/encoding/decoder.rs,8_096was passed tobrotli::DecompressorWriter::new().8_096was an accidental typo for8192(,192 - 96$).Writerpre-allocates 8 KiB) and 32 KiB (encoder.rs).Stacked PR Note
This PR is kept strictly minimal (~6 lines) to make review trivial. A stacked PR adding comprehensive unit test coverage for
Decoderacross sub-page, boundary, and multi-page chunks is ready and will follow right on top of this.Note: Burned my hand today so typing is a bit slow, will submit the other audited fixes from the telemetry report tomorrow!