aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-08-19 20:11:39 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-08-19 20:11:39 +0000
commit5a52d67a0899031bfb4d93fbee76e3d0c6c32558 (patch)
tree37adbc31adf1ce1d2f87c482e306c36282dd4ebf /src
parent79a12b64f13440c4ba63fc668eae37fc03ee0773 (diff)
downloadnginx-5a52d67a0899031bfb4d93fbee76e3d0c6c32558.tar.gz
nginx-5a52d67a0899031bfb4d93fbee76e3d0c6c32558.zip
Fix ignored headers handling in fastcgi/scgi/uwsgi.
The bug had appeared in r3561 (fastcgi), r3638 (scgi), r3567 (uwsgi).
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c10
-rw-r--r--src/http/modules/ngx_http_scgi_module.c10
-rw-r--r--src/http/modules/ngx_http_uwsgi_module.c10
3 files changed, 27 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 71194fd20..0bc95f8da 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -737,7 +737,15 @@ ngx_http_fastcgi_create_request(ngx_http_request_t *r)
lowcase_key = NULL;
if (flcf->header_params) {
- ignored = ngx_palloc(r->pool, flcf->header_params * sizeof(void *));
+ n = 0;
+ part = &r->headers_in.headers.part;
+
+ while (part) {
+ n += part->nelts;
+ part = part->next;
+ }
+
+ ignored = ngx_palloc(r->pool, n * sizeof(void *));
if (ignored == NULL) {
return NGX_ERROR;
}
diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
index c83d77044..a4230a956 100644
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -561,7 +561,15 @@ ngx_http_scgi_create_request(ngx_http_request_t *r)
lowcase_key = NULL;
if (scf->header_params) {
- ignored = ngx_palloc(r->pool, scf->header_params * sizeof(void *));
+ n = 0;
+ part = &r->headers_in.headers.part;
+
+ while (part) {
+ n += part->nelts;
+ part = part->next;
+ }
+
+ ignored = ngx_palloc(r->pool, n * sizeof(void *));
if (ignored == NULL) {
return NGX_ERROR;
}
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
index a907e53b8..37b763292 100644
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -589,7 +589,15 @@ ngx_http_uwsgi_create_request(ngx_http_request_t *r)
lowcase_key = NULL;
if (uwcf->header_params) {
- ignored = ngx_palloc(r->pool, uwcf->header_params * sizeof(void *));
+ n = 0;
+ part = &r->headers_in.headers.part;
+
+ while (part) {
+ n += part->nelts;
+ part = part->next;
+ }
+
+ ignored = ngx_palloc(r->pool, n * sizeof(void *));
if (ignored == NULL) {
return NGX_ERROR;
}