1
0
mirror of https://github.com/openresty/openresty.git synced 2024-10-13 00:29:41 +00:00
Files
clients
demo
misc
patches
lua-5.1.4-makefile_install_fix.patch
lua_cjson-1.0.2-array_detection_fix.patch
nginx-0.8.54-allow_request_body_updating.patch
nginx-0.8.54-named_location_clear_mods_ctx.patch
nginx-0.8.54-no_Werror.patch
nginx-0.8.54-no_error_pages.patch
nginx-0.8.54-redirect_memcpy_overlap.patch
nginx-0.8.54-request_body_in_single_buf.patch
nginx-0.8.54-request_body_preread_fix.patch
nginx-0.8.54-server_header.patch
nginx-0.8.54-subrequest_loop.patch
nginx-0.8.54-variable_header_ignore_no_hash.patch
nginx-1.0.10-allow_request_body_updating.patch
nginx-1.0.10-epoll_check_stale_wev.patch
nginx-1.0.10-gzip_empty_flush_buf.patch
nginx-1.0.10-log_escape_non_ascii.patch
nginx-1.0.10-named_location_clear_mods_ctx.patch
nginx-1.0.10-no_Werror.patch
nginx-1.0.10-no_error_pages.patch
nginx-1.0.10-no_pool.patch
nginx-1.0.10-request_body_in_single_buf.patch
nginx-1.0.10-request_body_preread_fix.patch
nginx-1.0.10-server_header.patch
nginx-1.0.10-subrequest_loop.patch
nginx-1.0.10-variable_header_ignore_no_hash.patch
nginx-1.0.11-allow_request_body_updating.patch
nginx-1.0.11-epoll_check_stale_wev.patch
nginx-1.0.11-gzip_empty_flush_buf.patch
nginx-1.0.11-log_escape_non_ascii.patch
nginx-1.0.11-max_subrequests.patch
nginx-1.0.11-named_location_clear_mods_ctx.patch
nginx-1.0.11-no_Werror.patch
nginx-1.0.11-no_error_pages.patch
nginx-1.0.11-no_pool.patch
nginx-1.0.11-null-character-fixes.patch
nginx-1.0.11-request_body_in_single_buf.patch
nginx-1.0.11-request_body_preread_fix.patch
nginx-1.0.11-server_header.patch
nginx-1.0.11-subrequest_loop.patch
nginx-1.0.11-variable_header_ignore_no_hash.patch
nginx-1.0.12-allow_request_body_updating.patch
nginx-1.0.12-epoll_check_stale_wev.patch
nginx-1.0.12-gzip_empty_flush_buf.patch
nginx-1.0.12-log_escape_non_ascii.patch
nginx-1.0.12-max_subrequests.patch
nginx-1.0.12-named_location_clear_mods_ctx.patch
nginx-1.0.12-no_Werror.patch
nginx-1.0.12-no_error_pages.patch
nginx-1.0.12-no_pool.patch
nginx-1.0.12-request_body_in_single_buf.patch
nginx-1.0.12-request_body_preread_fix.patch
nginx-1.0.12-server_header.patch
nginx-1.0.12-subrequest_loop.patch
nginx-1.0.12-variable_header_ignore_no_hash.patch
nginx-1.0.4-gcc46_fixes.patch
nginx-1.0.4-no_Werror.patch
nginx-1.0.4-no_error_pages.patch
nginx-1.0.4-no_pool.patch
nginx-1.0.4-request_body_in_single_buf.patch
nginx-1.0.4-request_body_preread_fix.patch
nginx-1.0.4-server_header.patch
nginx-1.0.4-subrequest_loop.patch
nginx-1.0.5-no_Werror.patch
nginx-1.0.5-no_error_pages.patch
nginx-1.0.5-no_pool.patch
nginx-1.0.5-request_body_in_single_buf.patch
nginx-1.0.5-request_body_preread_fix.patch
nginx-1.0.5-server_header.patch
nginx-1.0.5-subrequest_loop.patch
nginx-1.0.6-gzip_empty_flush_buf.patch
nginx-1.0.6-no_Werror.patch
nginx-1.0.6-no_error_pages.patch
nginx-1.0.6-no_pool.patch
nginx-1.0.6-request_body_in_single_buf.patch
nginx-1.0.6-request_body_preread_fix.patch
nginx-1.0.6-server_header.patch
nginx-1.0.6-subrequest_loop.patch
nginx-1.0.6-variable_header_ignore_no_hash.patch
nginx-1.0.8-allow_request_body_updating.patch
nginx-1.0.8-gzip_empty_flush_buf.patch
nginx-1.0.8-named_location_clear_mods_ctx.patch
nginx-1.0.8-no_Werror.patch
nginx-1.0.8-no_error_pages.patch
nginx-1.0.8-no_pool.patch
nginx-1.0.8-request_body_in_single_buf.patch
nginx-1.0.8-request_body_preread_fix.patch
nginx-1.0.8-server_header.patch
nginx-1.0.8-subrequest_loop.patch
nginx-1.0.8-variable_header_ignore_no_hash.patch
nginx-1.0.9-allow_request_body_updating.patch
nginx-1.0.9-epoll_check_stale_wev.patch
nginx-1.0.9-gzip_empty_flush_buf.patch
nginx-1.0.9-log_escape_non_ascii.patch
nginx-1.0.9-named_location_clear_mods_ctx.patch
nginx-1.0.9-no_Werror.patch
nginx-1.0.9-no_error_pages.patch
nginx-1.0.9-no_pool.patch
nginx-1.0.9-request_body_in_single_buf.patch
nginx-1.0.9-request_body_preread_fix.patch
nginx-1.0.9-server_header.patch
nginx-1.0.9-subrequest_loop.patch
nginx-1.0.9-variable_header_ignore_no_hash.patch
nginx-1.1.15-allow_request_body_updating.patch
nginx-1.1.15-epoll_check_stale_wev.patch
nginx-1.1.15-gzip_empty_flush_buf.patch
nginx-1.1.15-log_escape_non_ascii.patch
nginx-1.1.15-named_location_clear_mods_ctx.patch
nginx-1.1.15-no_Werror.patch
nginx-1.1.15-no_error_pages.patch
nginx-1.1.15-no_pool.patch
nginx-1.1.15-request_body_in_single_buf.patch
nginx-1.1.15-request_body_preread_fix.patch
nginx-1.1.15-server_header.patch
nginx-1.1.15-subrequest_loop.patch
nginx-1.1.15-variable_header_ignore_no_hash.patch
nginx-1.1.2-no_error_pages.patch
nginx-1.1.4-variable_header_ignore_no_hash.patch
nginx-1.1.5-named_location_clear_mods_ctx.patch
specs
t
util
.gitignore
Makefile
README
openresty/patches/nginx-1.0.6-variable_header_ignore_no_hash.patch
2011-09-30 11:43:31 -07:00

70 lines
1.4 KiB
Diff

--- 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];