mirror of
https://github.com/nginx/nginx.git
synced 2025-06-08 02:02:38 +08:00
rename core_srv_conf fields to more understandable default_server and server
This commit is contained in:
parent
f2694cb925
commit
cd8b43cde7
@ -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].core_srv_conf = cscf;
|
||||
addr[i].default_server = cscf;
|
||||
}
|
||||
|
||||
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->regex = NULL;
|
||||
#endif
|
||||
addr->core_srv_conf = cscf;
|
||||
addr->default_server = cscf;
|
||||
addr->servers.elts = NULL;
|
||||
|
||||
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 (NGX_PCRE)
|
||||
|| addr[a].core_srv_conf->captures
|
||||
|| addr[a].default_server->captures
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@ -1388,7 +1388,7 @@ ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
|
||||
}
|
||||
#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);
|
||||
|
||||
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;
|
||||
|
||||
cscf = addr->core_srv_conf;
|
||||
cscf = addr->default_server;
|
||||
ls->pool_size = cscf->connection_pool_size;
|
||||
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;
|
||||
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)
|
||||
addrs[i].conf.ssl = addr[i].opt.ssl;
|
||||
#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;
|
||||
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)
|
||||
addrs6[i].conf.ssl = addr[i].opt.ssl;
|
||||
#endif
|
||||
|
@ -2877,7 +2877,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
|
||||
#if (NGX_PCRE)
|
||||
sn->regex = NULL;
|
||||
#endif
|
||||
sn->core_srv_conf = conf;
|
||||
sn->server = conf;
|
||||
sn->name.len = conf->server_name.len;
|
||||
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)
|
||||
sn->regex = NULL;
|
||||
#endif
|
||||
sn->core_srv_conf = cscf;
|
||||
sn->server = cscf;
|
||||
sn->name = value[i];
|
||||
|
||||
ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
|
||||
|
@ -177,7 +177,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 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;
|
||||
|
||||
@ -230,7 +230,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
/* 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_http_conf_addr_t;
|
||||
|
||||
@ -239,7 +239,7 @@ struct ngx_http_server_name_s {
|
||||
#if (NGX_PCRE)
|
||||
ngx_regex_t *regex;
|
||||
#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;
|
||||
};
|
||||
|
||||
|
@ -381,7 +381,7 @@ ngx_http_init_request(ngx_event_t *rev)
|
||||
r->virtual_names = addr_conf->virtual_names;
|
||||
|
||||
/* 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->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++) {
|
||||
|
||||
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;
|
||||
|
||||
@ -1730,7 +1730,7 @@ ngx_http_find_virtual_server(ngx_http_request_t *r, u_char *host, size_t len)
|
||||
|
||||
/* match */
|
||||
|
||||
cscf = sn[i].core_srv_conf;
|
||||
cscf = sn[i].server;
|
||||
|
||||
r->ncaptures = ncaptures;
|
||||
r->captures_data = host;
|
||||
|
Loading…
Reference in New Issue
Block a user