diff src/http/ngx_http_core_module.c @ 335:d4241d7787fe

nginx-0.0.3-2004-05-14-20:51:47 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2004 16:51:47 +0000
parents af451db3fe99
children 8c5b69141dfd
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -37,6 +37,14 @@ static char *ngx_http_lowat_check(ngx_co
 static ngx_conf_post_t  ngx_http_lowat_post = { ngx_http_lowat_check } ;
 
 
+static ngx_conf_enum_t  ngx_http_restrict_host_names[] = {
+    { ngx_string("off"), NGX_HTTP_RESTRICT_HOST_OFF },
+    { ngx_string("on"), NGX_HTTP_RESTRICT_HOST_ON },
+    { ngx_string("close"), NGX_HTTP_RESTRICT_HOST_CLOSE },
+    { ngx_null_string, 0 }
+};
+
+
 static ngx_command_t  ngx_http_core_commands[] = {
 
     { ngx_string("server"),
@@ -88,6 +96,13 @@ static ngx_command_t  ngx_http_core_comm
       offsetof(ngx_http_core_srv_conf_t, large_client_header),
       NULL },
 
+    { ngx_string("restrict_host_names"),
+      NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
+      ngx_conf_set_enum_slot,
+      NGX_HTTP_SRV_CONF_OFFSET,
+      offsetof(ngx_http_core_srv_conf_t, restrict_host_names),
+      &ngx_http_restrict_host_names },
+
     { ngx_string("location"),
       NGX_HTTP_SRV_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
       ngx_location_block,
@@ -1127,6 +1142,7 @@ static void *ngx_http_core_create_srv_co
     cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
     cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
     cscf->large_client_header = NGX_CONF_UNSET;
+    cscf->restrict_host_names = NGX_CONF_UNSET_UINT;
 
     return cscf;
 }
@@ -1182,6 +1198,8 @@ static char *ngx_http_core_merge_srv_con
                               prev->client_header_buffer_size, 1024);
     ngx_conf_merge_value(conf->large_client_header,
                          prev->large_client_header, 1);
+    ngx_conf_merge_unsigned_value(conf->restrict_host_names,
+                                  prev->restrict_host_names, 0);
 
     return NGX_CONF_OK;
 }