Repository navigation
refactor!: own buffer_param and fix content encoding never finishing - #296
Merged
Merged
Conversation
Capy removed buffer_param and buffer_slice and made consuming_buffers private. Add http::buffer_param, a copy of capy's, and use it in the type-erased sources and sinks, parser::read, and the content coding filter. Replace the parser's buffer_slice with buffer_copy's at_most argument, and adopt capy's renamed buffer functions. The filter now skips empty input buffers. The serializer's final call passes two empty buffers, which used to count as more input, so the encoder never received finish and a gzip encoded message never completed. buffer_param exposes one window of buffers at a time, so the filter counts the remaining bytes itself and parser::read keeps copying until the body is drained. Add tests for gzip encoding and for reading into many buffers.
The deflate and inflate filters never called deflate_end or inflate_end, so every gzip or deflate message leaked the zlib state. The brotli filter already releases its encoder in its destructor.
|
An automated preview of the documentation is available at https://296.http.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-10-30 22:01:50 UTC |
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.
Follows cppalliance/capy#479.
Capy removed
buffer_paramandbuffer_sliceand madeconsuming_buffersprivate.http::buffer_param/const_buffer_param, a copy of capy's, used by the type-erased sources and sinks,parser::read, and the content coding filter.buffer_slicewithbuffer_copy'sat_mostargument.Bug fix: content encoding never finishing. The filter now skips empty input buffers. The serializer's final call passes two empty buffers, which used to count as more input, so the encoder never received finish and a gzip encoded message never completed.
testGzipFinishescovers it and fails on the old code.buffer_paramexposes one window of buffers at a time, so the filter counts the remaining bytes itself andparser::readkeeps copying until the body is drained (testReadManyBuffers).Merge order: after cppalliance/capy#479. CI clones capy
develop, so it cannot pass until that merges.