From ee9cf6c407f9e0aebc75c6b08d781dc6fa2f6657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?agentzh=20=28=E7=AB=A0=E4=BA=A6=E6=98=A5=29?= Date: Fri, 30 Sep 2011 11:43:31 -0700 Subject: [PATCH] checked in the variable_header_ignore_no_hash patch. --- ...1.0.6-variable_header_ignore_no_hash.patch | 69 +++++++++++++++++++ ...1.1.4-variable_header_ignore_no_hash.patch | 69 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 patches/nginx-1.0.6-variable_header_ignore_no_hash.patch create mode 100644 patches/nginx-1.1.4-variable_header_ignore_no_hash.patch diff --git a/patches/nginx-1.0.6-variable_header_ignore_no_hash.patch b/patches/nginx-1.0.6-variable_header_ignore_no_hash.patch new file mode 100644 index 000000000..867fe8c58 --- /dev/null +++ b/patches/nginx-1.0.6-variable_header_ignore_no_hash.patch @@ -0,0 +1,69 @@ +--- nginx-1.0.6/src/http/ngx_http_variables.c 2011-05-30 05:36:17.000000000 -0700 ++++ nginx-1.0.6-patched/src/http/ngx_http_variables.c 2011-09-30 10:59:05.000000000 -0700 +@@ -648,7 +648,17 @@ + + a = (ngx_array_t *) ((char *) r + data); + +- n = a->nelts; ++ h = a->elts; ++ n = 0; ++ ++ for (i = 0; i < a->nelts; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ ++ n++; ++ } + + if (n == 0) { + v->not_found = 1; +@@ -659,9 +669,7 @@ + v->no_cacheable = 0; + v->not_found = 0; + +- h = a->elts; +- +- if (n == 1) { ++ if (n == 1 && a->nelts == 1) { + v->len = (*h)->value.len; + v->data = (*h)->value.data; + +@@ -670,7 +678,12 @@ + + len = - (ssize_t) (sizeof("; ") - 1); + +- for (i = 0; i < n; i++) { ++ for (i = 0; i < a->nelts; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ + len += h[i]->value.len + sizeof("; ") - 1; + } + +@@ -683,6 +696,11 @@ + v->data = p; + + for (i = 0; /* void */ ; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ + p = ngx_copy(p, h[i]->value.data, h[i]->value.len); + + if (i == n - 1) { +@@ -738,6 +756,10 @@ + i = 0; + } + ++ if (header[i].hash == 0) { ++ continue; ++ } ++ + for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) { + ch = header[i].key.data[n]; + diff --git a/patches/nginx-1.1.4-variable_header_ignore_no_hash.patch b/patches/nginx-1.1.4-variable_header_ignore_no_hash.patch new file mode 100644 index 000000000..56e27571d --- /dev/null +++ b/patches/nginx-1.1.4-variable_header_ignore_no_hash.patch @@ -0,0 +1,69 @@ +--- nginx-1.1.4/src/http/ngx_http_variables.c 2011-05-30 05:36:17.000000000 -0700 ++++ nginx-1.1.4-patched/src/http/ngx_http_variables.c 2011-09-30 10:59:05.000000000 -0700 +@@ -648,7 +648,17 @@ + + a = (ngx_array_t *) ((char *) r + data); + +- n = a->nelts; ++ h = a->elts; ++ n = 0; ++ ++ for (i = 0; i < a->nelts; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ ++ n++; ++ } + + if (n == 0) { + v->not_found = 1; +@@ -659,9 +669,7 @@ + v->no_cacheable = 0; + v->not_found = 0; + +- h = a->elts; +- +- if (n == 1) { ++ if (n == 1 && a->nelts == 1) { + v->len = (*h)->value.len; + v->data = (*h)->value.data; + +@@ -670,7 +678,12 @@ + + len = - (ssize_t) (sizeof("; ") - 1); + +- for (i = 0; i < n; i++) { ++ for (i = 0; i < a->nelts; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ + len += h[i]->value.len + sizeof("; ") - 1; + } + +@@ -683,6 +696,11 @@ + v->data = p; + + for (i = 0; /* void */ ; i++) { ++ ++ if (h[i]->hash == 0) { ++ continue; ++ } ++ + p = ngx_copy(p, h[i]->value.data, h[i]->value.len); + + if (i == n - 1) { +@@ -738,6 +756,10 @@ + i = 0; + } + ++ if (header[i].hash == 0) { ++ continue; ++ } ++ + for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) { + ch = header[i].key.data[n]; +