rename core_srv_conf fields to more understandable default_server and server

This commit is contained in:
Igor Sysoev 2009-10-21 16:52:10 +00:00
parent f2694cb925
commit cd8b43cde7
4 changed files with 15 additions and 15 deletions

View File

@ -1220,7 +1220,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
} }
addr[i].opt = *lsopt; addr[i].opt = *lsopt;
addr[i].core_srv_conf = cscf; addr[i].default_server = cscf;
} }
return NGX_OK; return NGX_OK;
@ -1266,7 +1266,7 @@ ngx_http_add_address(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
addr->nregex = 0; addr->nregex = 0;
addr->regex = NULL; addr->regex = NULL;
#endif #endif
addr->core_srv_conf = cscf; addr->default_server = cscf;
addr->servers.elts = NULL; addr->servers.elts = NULL;
return ngx_http_add_server(cf, cscf, addr); return ngx_http_add_server(cf, cscf, addr);
@ -1325,7 +1325,7 @@ ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
if (addr[a].servers.nelts > 1 if (addr[a].servers.nelts > 1
#if (NGX_PCRE) #if (NGX_PCRE)
|| addr[a].core_srv_conf->captures || addr[a].default_server->captures
#endif #endif
) )
{ {
@ -1388,7 +1388,7 @@ ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
} }
#endif #endif
rc = ngx_hash_add_key(&ha, &name[n].name, name[n].core_srv_conf, rc = ngx_hash_add_key(&ha, &name[n].name, name[n].server,
NGX_HASH_WILDCARD_KEY); NGX_HASH_WILDCARD_KEY);
if (rc == NGX_ERROR) { if (rc == NGX_ERROR) {
@ -1636,7 +1636,7 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
ls->handler = ngx_http_init_connection; ls->handler = ngx_http_init_connection;
cscf = addr->core_srv_conf; cscf = addr->default_server;
ls->pool_size = cscf->connection_pool_size; ls->pool_size = cscf->connection_pool_size;
ls->post_accept_timeout = cscf->client_header_timeout; ls->post_accept_timeout = cscf->client_header_timeout;
@ -1698,7 +1698,7 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport,
sin = (struct sockaddr_in *) addr[i].opt.sockaddr; sin = (struct sockaddr_in *) addr[i].opt.sockaddr;
addrs[i].addr = sin->sin_addr.s_addr; addrs[i].addr = sin->sin_addr.s_addr;
addrs[i].conf.core_srv_conf = addr[i].core_srv_conf; addrs[i].conf.default_server = addr[i].default_server;
#if (NGX_HTTP_SSL) #if (NGX_HTTP_SSL)
addrs[i].conf.ssl = addr[i].opt.ssl; addrs[i].conf.ssl = addr[i].opt.ssl;
#endif #endif
@ -1759,7 +1759,7 @@ ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport,
sin6 = (struct sockaddr_in6 *) addr[i].opt.sockaddr; sin6 = (struct sockaddr_in6 *) addr[i].opt.sockaddr;
addrs6[i].addr6 = sin6->sin6_addr; addrs6[i].addr6 = sin6->sin6_addr;
addrs6[i].conf.core_srv_conf = addr[i].core_srv_conf; addrs6[i].conf.default_server = addr[i].default_server;
#if (NGX_HTTP_SSL) #if (NGX_HTTP_SSL)
addrs6[i].conf.ssl = addr[i].opt.ssl; addrs6[i].conf.ssl = addr[i].opt.ssl;
#endif #endif

View File

@ -2877,7 +2877,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
#if (NGX_PCRE) #if (NGX_PCRE)
sn->regex = NULL; sn->regex = NULL;
#endif #endif
sn->core_srv_conf = conf; sn->server = conf;
sn->name.len = conf->server_name.len; sn->name.len = conf->server_name.len;
sn->name.data = conf->server_name.data; sn->name.data = conf->server_name.data;
} }
@ -3529,7 +3529,7 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
#if (NGX_PCRE) #if (NGX_PCRE)
sn->regex = NULL; sn->regex = NULL;
#endif #endif
sn->core_srv_conf = cscf; sn->server = cscf;
sn->name = value[i]; sn->name = value[i];
ngx_strlow(sn->name.data, sn->name.data, sn->name.len); ngx_strlow(sn->name.data, sn->name.data, sn->name.len);

View File

@ -177,7 +177,7 @@ typedef struct {
typedef struct { typedef struct {
/* the default server configuration for this address:port */ /* the default server configuration for this address:port */
ngx_http_core_srv_conf_t *core_srv_conf; ngx_http_core_srv_conf_t *default_server;
ngx_http_virtual_names_t *virtual_names; ngx_http_virtual_names_t *virtual_names;
@ -230,7 +230,7 @@ typedef struct {
#endif #endif
/* the default server configuration for this address:port */ /* the default server configuration for this address:port */
ngx_http_core_srv_conf_t *core_srv_conf; ngx_http_core_srv_conf_t *default_server;
ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */ ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */
} ngx_http_conf_addr_t; } ngx_http_conf_addr_t;
@ -239,7 +239,7 @@ struct ngx_http_server_name_s {
#if (NGX_PCRE) #if (NGX_PCRE)
ngx_regex_t *regex; ngx_regex_t *regex;
#endif #endif
ngx_http_core_srv_conf_t *core_srv_conf; /* virtual name server conf */ ngx_http_core_srv_conf_t *server; /* virtual name server conf */
ngx_str_t name; ngx_str_t name;
}; };

View File

@ -381,7 +381,7 @@ ngx_http_init_request(ngx_event_t *rev)
r->virtual_names = addr_conf->virtual_names; r->virtual_names = addr_conf->virtual_names;
/* the default server configuration for the address:port */ /* the default server configuration for the address:port */
cscf = addr_conf->core_srv_conf; cscf = addr_conf->default_server;
r->main_conf = cscf->ctx->main_conf; r->main_conf = cscf->ctx->main_conf;
r->srv_conf = cscf->ctx->srv_conf; r->srv_conf = cscf->ctx->srv_conf;
@ -1704,7 +1704,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
for (i = 0; i < r->virtual_names->nregex; i++) { for (i = 0; i < r->virtual_names->nregex; i++) {
if (sn[i].core_srv_conf->captures && r->captures == NULL) { if (sn[i].server->captures && r->captures == NULL) {
ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3; ncaptures = (NGX_HTTP_MAX_CAPTURES + 1) * 3;
@ -1730,7 +1730,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
/* match */ /* match */
cscf = sn[i].core_srv_conf; cscf = sn[i].server;
r->ncaptures = ncaptures; r->ncaptures = ncaptures;
r->captures_data = host; r->captures_data = host;