aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-05-11 14:43:47 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-05-11 14:43:47 +0000
commit3338cfdfbc5522ca96319ece6d21ddc4d1dce45d (patch)
tree1e668fefd76a974c8ffdb0db6813022a6eb64e76 /src/http/ngx_http.c
parent418843dc7f2ff90ae371f41e5fea810e10e59317 (diff)
downloadnginx-3338cfdfbc5522ca96319ece6d21ddc4d1dce45d.tar.gz
nginx-3338cfdfbc5522ca96319ece6d21ddc4d1dce45d.zip
nginx-0.3.46-RELEASE importrelease-0.3.46
*) Feature: the "proxy_hide_header", "proxy_pass_header", "fastcgi_hide_header", and "fastcgi_pass_header" directives. *) Change: the "proxy_pass_x_powered_by", "fastcgi_x_powered_by", and "proxy_pass_server" directives were canceled. *) Feature: the "X-Accel-Buffering" response header line is supported in proxy mode. *) Bugfix: the reconfiguration bug and memory leaks in the ngx_http_perl_module.
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index a15b3e3cd..88667c63b 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -79,11 +79,13 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_uint_t mi, m, s, l, p, a, i;
ngx_uint_t last, bind_all, done;
ngx_conf_t pcf;
- ngx_array_t in_ports;
+ ngx_array_t headers_in, in_ports;
+ ngx_hash_key_t *hk;
ngx_hash_init_t hash;
ngx_listening_t *ls;
ngx_http_listen_t *lscf;
ngx_http_module_t *module;
+ ngx_http_header_t *header;
ngx_http_in_port_t *hip;
ngx_http_handler_pt *h;
ngx_http_conf_ctx_t *ctx;
@@ -373,21 +375,35 @@ ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
cmcf->phases[NGX_HTTP_LOG_PHASE].type = NGX_OK;
- cmcf->headers_in_hash.max_size = 200;
- cmcf->headers_in_hash.bucket_limit = 1;
- cmcf->headers_in_hash.bucket_size = sizeof(ngx_http_header_t);
- cmcf->headers_in_hash.name = "http headers_in";
-
- if (ngx_hash0_init(&cmcf->headers_in_hash, cf->pool, ngx_http_headers_in, 0)
+ if (ngx_array_init(&headers_in, cf->temp_pool, 32, sizeof(ngx_hash_key_t))
!= NGX_OK)
{
return NGX_CONF_ERROR;
}
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, cf->log, 0,
- "http headers_in hash size: %ui, max buckets per entry: %ui",
- cmcf->headers_in_hash.hash_size,
- cmcf->headers_in_hash.min_buckets);
+ for (header = ngx_http_headers_in; header->name.len; header++) {
+ hk = ngx_array_push(&headers_in);
+ if (hk == NULL) {
+ return NGX_CONF_ERROR;
+ }
+
+ hk->key = header->name;
+ hk->key_hash = ngx_hash_key_lc(header->name.data, header->name.len);
+ hk->value = header;
+ }
+
+ hash.hash = &cmcf->headers_in_hash;
+ hash.key = ngx_hash_key_lc;
+ hash.max_size = 512;
+ hash.bucket_size = ngx_cacheline_size;
+ hash.name = "headers_in_hash";
+ hash.pool = cf->pool;
+ hash.temp_pool = NULL;
+
+ if (ngx_hash_init(&hash, headers_in.elts, headers_in.nelts) != NGX_OK) {
+ return NGX_CONF_ERROR;
+ }
+
for (m = 0; ngx_modules[m]; m++) {
if (ngx_modules[m]->type != NGX_HTTP_MODULE) {