mod_proxy_fcgi: Support Dynamic Buffering for Large FastCGI Headers#522
Open
arturobernalg wants to merge 1 commit intoapache:trunkfrom
Open
mod_proxy_fcgi: Support Dynamic Buffering for Large FastCGI Headers#522arturobernalg wants to merge 1 commit intoapache:trunkfrom
arturobernalg wants to merge 1 commit intoapache:trunkfrom
Conversation
notroj
reviewed
Mar 11, 2025
modules/proxy/mod_proxy_fcgi.c
Outdated
| return 0; | ||
| } | ||
|
|
||
| /** |
Collaborator
There was a problem hiding this comment.
This part should be added to the varbuf API in server/util.c or else the existing ap_varbuf_* should be used, IMO.
Member
Author
There was a problem hiding this comment.
sound reasonable move it to server/util.c
modules/proxy/mod_proxy_fcgi.c
Outdated
| ob = apr_brigade_create(r->pool, c->bucket_alloc); | ||
|
|
||
| /* Create our dynamic header buffer for large headers */ | ||
| ap_varbuf *header_vb = NULL; |
Collaborator
There was a problem hiding this comment.
Declaration should be at the top of the function, this is causing the CI failures.
60c3136 to
6f2a011
Compare
This patch fixes Bug 64919 by replacing the fixed 8192‐byte header buffer with a dynamically resizable buffer that can handle arbitrarily long headers. It also adds a trimming step to remove any leading whitespace from the header data before parsing, ensuring that FastCGI responses are correctly interpreted.
d209278 to
0eec747
Compare
|
Hey @notroj & @arturobernalg! Wondering if there is more work needed here or if there's additional steps to take. Happy to help out if so! :) |
bukka
reviewed
Dec 3, 2025
| * headers, so this part of the data will need | ||
| * to persist. */ | ||
| apr_bucket_setaside(b, setaside_pool); | ||
| } |
There was a problem hiding this comment.
this needs probably change indent for the above code...
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.
This pull request implements a dynamic header buffer in mod_proxy_fcgi to resolve Bug 64919. Previously, mod_proxy_fcgi used a fixed 8192-byte buffer to parse FastCGI headers, which caused failures when PHP-FPM (or similar backends) generated headers exceeding that size. With this patch, a dynamically resizable buffer is used so that arbitrarily large headers are handled gracefully.