summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_scgi_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-08-29 14:13:46 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-08-29 14:13:46 +0000
commit5c4e11692d0479868b27d1c4408993c335f23506 (patch)
tree44d11decd4e272b8dd8d6e18598c85a853ed4fcd /src/http/modules/ngx_http_scgi_module.c
parent15490855b8a6b42b250881314048b22cc012442c (diff)
downloadnginx-5c4e11692d0479868b27d1c4408993c335f23506.tar.gz
nginx-5c4e11692d0479868b27d1c4408993c335f23506.tar.bz2
Merge of r4016:
Fix ignored headers handling in fastcgi/scgi/uwsgi. The bug had appeared in r3561 (fastcgi), r3638 (scgi), r3567 (uwsgi).
Diffstat (limited to 'src/http/modules/ngx_http_scgi_module.c')
-rw-r--r--src/http/modules/ngx_http_scgi_module.c10
1 files changed, 9 insertions, 1 deletions
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;
}