feat(httpsys): support chunked transfer-encoding - #35
Open
thy69 wants to merge 2 commits into
Open
Conversation
http.sys de-chunks request bodies natively; read until ERROR_HANDLE_EOF instead of relying on Content-Length. Bodies of unknown length are capped by MaxInputCountLength (default 100 MB) and rejected with 413 beyond that. Decompression path now shared by both read paths. Propagate MaxInputCountLength in Clone. Refs QuBES #1333
thy69
marked this pull request as draft
August 19, 2026 13:36
- grow read buffer geometrically to avoid O(n^2) reallocations - cancel request after 413 so the unread body cannot flood the connection - cap decompressed size too: the wire cap only bounds compressed bytes, leaving decompression bombs unchecked - hoist flags computation out of both read loops Refs QuBES #1333
thy69
marked this pull request as ready for review
August 19, 2026 13:54
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
Adds support for
Transfer-Encoding: chunkedrequest bodies inTHttpApi2Server(dwsHTTPSysServer.pas).Content-Length), the body is now read in 64 KB increments untilERROR_HANDLE_EOFinstead of relying onContent-Length.MaxInputCountLength(default 100 MB) and rejected with413 Payload Too Largebeyond that, enforced cumulatively while reading.Content-Encoding) is now shared by both read paths (known-length and chunked).MaxInputCountLengthis now propagated inClone.Refs QuBES #1333
🤖 Generated with Claude Code