aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-06-25 14:42:03 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-06-25 14:42:03 +0000
commitb1af9bbcabf1bdbe119366971a2d0f6c3f8f595d (patch)
tree620831fd01e5fd9914385c3a461b09811ed0dd65 /src/http/ngx_http_core_module.c
parent59f3aa3a9baeab8c8277332e75a83f134d1e026a (diff)
downloadnginx-b1af9bbcabf1bdbe119366971a2d0f6c3f8f595d.tar.gz
nginx-b1af9bbcabf1bdbe119366971a2d0f6c3f8f595d.zip
nginx-0.0.7-2004-06-25-18:42:03 import
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 5e43d5dd3..2761afb5f 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1158,8 +1158,10 @@ static char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf,
ngx_http_core_srv_conf_t *prev = parent;
ngx_http_core_srv_conf_t *conf = child;
- ngx_http_listen_t *l;
- ngx_http_server_name_t *n;
+ ngx_http_listen_t *l;
+ ngx_http_conf_ctx_t *ctx;
+ ngx_http_server_name_t *n;
+ ngx_http_core_main_conf_t *cmcf;
/* TODO: it does not merge, it inits only */
@@ -1188,6 +1190,14 @@ static char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf,
n->name.len = ngx_strlen(n->name.data);
n->core_srv_conf = conf;
+
+ ctx = (ngx_http_conf_ctx_t *)
+ cf->cycle->conf_ctx[ngx_http_module.index];
+ cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
+
+ if (cmcf->max_server_name_len < n->name.len) {
+ cmcf->max_server_name_len = n->name.len;
+ }
}
ngx_conf_merge_size_value(conf->connection_pool_size,
@@ -1425,13 +1435,18 @@ static char *ngx_set_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_core_srv_conf_t *scf = conf;
- ngx_uint_t i;
- ngx_str_t *value;
- ngx_http_server_name_t *sn;
+ ngx_uint_t i;
+ ngx_str_t *value;
+ ngx_http_conf_ctx_t *ctx;
+ ngx_http_server_name_t *sn;
+ ngx_http_core_main_conf_t *cmcf;
/* TODO: several names */
/* TODO: warn about duplicate 'server_name' directives */
+ ctx = (ngx_http_conf_ctx_t *) cf->cycle->conf_ctx[ngx_http_module.index];
+ cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
+
value = cf->args->elts;
for (i = 1; i < cf->args->nelts; i++) {
@@ -1448,6 +1463,10 @@ static char *ngx_set_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
sn->name.len = value[i].len;
sn->name.data = value[i].data;
sn->core_srv_conf = scf;
+
+ if (cmcf->max_server_name_len < sn->name.len) {
+ cmcf->max_server_name_len = sn->name.len;
+ }
}
return NGX_CONF_OK;