Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 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 | bfcc1a6dd184 |
comparison
equal
deleted
inserted
replaced
3220:cdcd9e29c589 | 3221:c8de5a8b6d17 |
---|---|
1218 "the duplicate default server"); | 1218 "the duplicate default server"); |
1219 return NGX_ERROR; | 1219 return NGX_ERROR; |
1220 } | 1220 } |
1221 | 1221 |
1222 addr[i].opt = *lsopt; | 1222 addr[i].opt = *lsopt; |
1223 addr[i].core_srv_conf = cscf; | 1223 addr[i].default_server = cscf; |
1224 } | 1224 } |
1225 | 1225 |
1226 return NGX_OK; | 1226 return NGX_OK; |
1227 } | 1227 } |
1228 | 1228 |
1264 addr->wc_tail = NULL; | 1264 addr->wc_tail = NULL; |
1265 #if (NGX_PCRE) | 1265 #if (NGX_PCRE) |
1266 addr->nregex = 0; | 1266 addr->nregex = 0; |
1267 addr->regex = NULL; | 1267 addr->regex = NULL; |
1268 #endif | 1268 #endif |
1269 addr->core_srv_conf = cscf; | 1269 addr->default_server = cscf; |
1270 addr->servers.elts = NULL; | 1270 addr->servers.elts = NULL; |
1271 | 1271 |
1272 return ngx_http_add_server(cf, cscf, addr); | 1272 return ngx_http_add_server(cf, cscf, addr); |
1273 } | 1273 } |
1274 | 1274 |
1323 addr = port[p].addrs.elts; | 1323 addr = port[p].addrs.elts; |
1324 for (a = 0; a < port[p].addrs.nelts; a++) { | 1324 for (a = 0; a < port[p].addrs.nelts; a++) { |
1325 | 1325 |
1326 if (addr[a].servers.nelts > 1 | 1326 if (addr[a].servers.nelts > 1 |
1327 #if (NGX_PCRE) | 1327 #if (NGX_PCRE) |
1328 || addr[a].core_srv_conf->captures | 1328 || addr[a].default_server->captures |
1329 #endif | 1329 #endif |
1330 ) | 1330 ) |
1331 { | 1331 { |
1332 if (ngx_http_server_names(cf, cmcf, &addr[a]) != NGX_OK) { | 1332 if (ngx_http_server_names(cf, cmcf, &addr[a]) != NGX_OK) { |
1333 return NGX_ERROR; | 1333 return NGX_ERROR; |
1386 regex++; | 1386 regex++; |
1387 continue; | 1387 continue; |
1388 } | 1388 } |
1389 #endif | 1389 #endif |
1390 | 1390 |
1391 rc = ngx_hash_add_key(&ha, &name[n].name, name[n].core_srv_conf, | 1391 rc = ngx_hash_add_key(&ha, &name[n].name, name[n].server, |
1392 NGX_HASH_WILDCARD_KEY); | 1392 NGX_HASH_WILDCARD_KEY); |
1393 | 1393 |
1394 if (rc == NGX_ERROR) { | 1394 if (rc == NGX_ERROR) { |
1395 return NGX_ERROR; | 1395 return NGX_ERROR; |
1396 } | 1396 } |
1634 | 1634 |
1635 ls->addr_ntop = 1; | 1635 ls->addr_ntop = 1; |
1636 | 1636 |
1637 ls->handler = ngx_http_init_connection; | 1637 ls->handler = ngx_http_init_connection; |
1638 | 1638 |
1639 cscf = addr->core_srv_conf; | 1639 cscf = addr->default_server; |
1640 ls->pool_size = cscf->connection_pool_size; | 1640 ls->pool_size = cscf->connection_pool_size; |
1641 ls->post_accept_timeout = cscf->client_header_timeout; | 1641 ls->post_accept_timeout = cscf->client_header_timeout; |
1642 | 1642 |
1643 clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index]; | 1643 clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index]; |
1644 | 1644 |
1696 | 1696 |
1697 for (i = 0; i < hport->naddrs; i++) { | 1697 for (i = 0; i < hport->naddrs; i++) { |
1698 | 1698 |
1699 sin = (struct sockaddr_in *) addr[i].opt.sockaddr; | 1699 sin = (struct sockaddr_in *) addr[i].opt.sockaddr; |
1700 addrs[i].addr = sin->sin_addr.s_addr; | 1700 addrs[i].addr = sin->sin_addr.s_addr; |
1701 addrs[i].conf.core_srv_conf = addr[i].core_srv_conf; | 1701 addrs[i].conf.default_server = addr[i].default_server; |
1702 #if (NGX_HTTP_SSL) | 1702 #if (NGX_HTTP_SSL) |
1703 addrs[i].conf.ssl = addr[i].opt.ssl; | 1703 addrs[i].conf.ssl = addr[i].opt.ssl; |
1704 #endif | 1704 #endif |
1705 | 1705 |
1706 if (addr[i].hash.buckets == NULL | 1706 if (addr[i].hash.buckets == NULL |
1757 | 1757 |
1758 for (i = 0; i < hport->naddrs; i++) { | 1758 for (i = 0; i < hport->naddrs; i++) { |
1759 | 1759 |
1760 sin6 = (struct sockaddr_in6 *) addr[i].opt.sockaddr; | 1760 sin6 = (struct sockaddr_in6 *) addr[i].opt.sockaddr; |
1761 addrs6[i].addr6 = sin6->sin6_addr; | 1761 addrs6[i].addr6 = sin6->sin6_addr; |
1762 addrs6[i].conf.core_srv_conf = addr[i].core_srv_conf; | 1762 addrs6[i].conf.default_server = addr[i].default_server; |
1763 #if (NGX_HTTP_SSL) | 1763 #if (NGX_HTTP_SSL) |
1764 addrs6[i].conf.ssl = addr[i].opt.ssl; | 1764 addrs6[i].conf.ssl = addr[i].opt.ssl; |
1765 #endif | 1765 #endif |
1766 | 1766 |
1767 if (addr[i].hash.buckets == NULL | 1767 if (addr[i].hash.buckets == NULL |