Repository navigation
Conversation
Cache metadata is serialized as complete logical lines, but recall parsed each fixed-size read chunk as a separate line. Accumulate chunks through the terminating newline before parsing both header tables and Vary arrays. Add a regression covering a cached response header that spans the previous read boundary.
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
mod_cache_diskserializes each cache metadata entry as one logical line. On recall,read_table()andread_array()usedapr_file_gets()with a fixed buffer and parsed every returned chunk as a complete entry. A line longer than the buffer could therefore be split into multiple entries.This change accumulates chunks through the terminating LF before parsing the line, for both response-header tables and Vary arrays. The regression primes a disk-cache entry with a response header spanning the old read boundary and verifies that recall preserves the complete value as one field.
Testing
trunk: existing cache test passed; new regression failed.trunk:test/pytest_suite/tests/t/modules/test_cache.py— 2 passed.(see
SECURITY.mdandhttps://www.apache.org/security/#reporting-a-vulnerability).
APLOGNO()tag;numbers are assigned by a committer at merge time (see
docs/log-message-tags/README).changes-entries/*.txtfile is included,following the template in
README.CHANGES(not needed otherwise).