changeset 3221:c8de5a8b6d17

rename core_srv_conf fields to more understandable default_server and server
author Igor Sysoev <igor@sysoev.ru>
date Wed, 21 Oct 2009 16:52:10 +0000
parents cdcd9e29c589
children a4f264c43173
files src/http/ngx_http.c src/http/ngx_http_core_module.c src/http/ngx_http_core_module.h src/http/ngx_http_request.c
diffstat 4 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1220,7 +1220,7 @@ ngx_http_add_addresses(ngx_conf_t *cf, n
             }
 
             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
     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
 
             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, ng
             }
 #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, n
 
     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_h
 
         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_
 
         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
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -2877,7 +2877,7 @@ ngx_http_core_merge_srv_conf(ngx_conf_t 
 #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
 #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);
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -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;
 };
 
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -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_re
 
         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_re
 
             /* match */
 
-            cscf = sn[i].core_srv_conf;
+            cscf = sn[i].server;
 
             r->ncaptures = ncaptures;
             r->captures_data = host;