-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mod_proxy_fcgi: Support Dynamic Buffering for Large FastCGI Headers #522
base: trunk
Are you sure you want to change the base?
mod_proxy_fcgi: Support Dynamic Buffering for Large FastCGI Headers #522
Conversation
modules/proxy/mod_proxy_fcgi.c
Outdated
@@ -593,6 +594,72 @@ static int handle_headers(request_rec *r, int *state, | |||
return 0; | |||
} | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be added to the varbuf API in server/util.c or else the existing ap_varbuf_*
should be used, IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sound reasonable move it to server/util.c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please @notroj do another pass
modules/proxy/mod_proxy_fcgi.c
Outdated
@@ -640,6 +707,10 @@ static apr_status_t dispatch(proxy_conn_rec *conn, proxy_dir_conf *conf, | |||
ib = apr_brigade_create(r->pool, c->bucket_alloc); | |||
ob = apr_brigade_create(r->pool, c->bucket_alloc); | |||
|
|||
/* Create our dynamic header buffer for large headers */ | |||
ap_varbuf *header_vb = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declaration should be at the top of the function, this is causing the CI failures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix it
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
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.