diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-12-21 15:30:30 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-12-21 15:30:30 +0300 |
commit | b1dfe478a03ad6919f174812951f6a2bec8befae (patch) | |
tree | d8802484f8dbf5309b17a95b5fc9749627720a53 /src/http/ngx_http_core_module.c | |
parent | 5275a8b3ac534ff36973801ec2aa6ce1214d7cc9 (diff) |
nginx-0.1.13-RELEASE importrelease-0.1.13
*) Feature: the server_names_hash and server_names_hash_threshold
directives.
*) Bugfix: the *.domain.tld names in the "server_name" directive did
not work.
*) Bugfix: the %request_length log parameter logged the incorrect
length.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index e3ccd8ff6..478bb0811 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -60,6 +60,20 @@ static ngx_conf_enum_t ngx_http_restrict_host_names[] = { static ngx_command_t ngx_http_core_commands[] = { + { ngx_string("server_names_hash"), + NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_MAIN_CONF_OFFSET, + offsetof(ngx_http_core_main_conf_t, server_names_hash), + NULL }, + + { ngx_string("server_names_hash_threshold"), + NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1, + ngx_conf_set_num_slot, + NGX_HTTP_MAIN_CONF_OFFSET, + offsetof(ngx_http_core_main_conf_t, server_names_hash_threshold), + NULL }, + { ngx_string("server"), NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS, ngx_server_block, @@ -1244,17 +1258,24 @@ static void *ngx_http_core_create_main_conf(ngx_conf_t *cf) 5, sizeof(ngx_http_core_srv_conf_t *), NGX_CONF_ERROR); + cmcf->server_names_hash = NGX_CONF_UNSET_UINT; + cmcf->server_names_hash_threshold = NGX_CONF_UNSET_UINT; + return cmcf; } static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf) { -#if 0 ngx_http_core_main_conf_t *cmcf = conf; - /* TODO: remove it if no directives */ -#endif + if (cmcf->server_names_hash == NGX_CONF_UNSET_UINT) { + cmcf->server_names_hash = 1009; + } + + if (cmcf->server_names_hash_threshold == NGX_CONF_UNSET_UINT) { + cmcf->server_names_hash_threshold = 50; + } return NGX_CONF_OK; } |