comparison src/http/ngx_http.c @ 558:2da4537168f8 NGINX_0_8_31

nginx 0.8.31 *) Feature: now the "error_page" directive may redirect the 301 and 302 responses. *) Feature: the $geoip_city_continent_code, $geoip_latitude, and $geoip_longitude variables. Thanks to Arvind Sundararajan. *) Feature: now the ngx_http_image_filter_module deletes always EXIF and other application specific data if the data consume more than 5% of a JPEG file. *) Bugfix: nginx closed a connection if a cached response had an empty body. Thanks to Piotr Sikora. *) Bugfix: nginx might not be built by gcc 4.x if the -O2 or higher optimization option was used. Thanks to Maxim Dounin and Denis F. Latypoff. *) Bugfix: regular expressions in location were always tested in case-sensitive mode; the bug had appeared in 0.8.25. *) Bugfix: nginx cached a 304 response if there was the "If-None-Match" header line in a proxied request. Thanks to Tim Dettrick and David Kostal. *) Bugfix: nginx/Windows tried to delete a temporary file twice if the file should replace an already existent file.
author Igor Sysoev <http://sysoev.ru>
date Wed, 23 Dec 2009 00:00:00 +0300
parents 5c576ea5dbd9
children 4d3e880ce86c
comparison
equal deleted inserted replaced
557:72104cd120ec 558:2da4537168f8
1115 if (cmcf->ports == NULL) { 1115 if (cmcf->ports == NULL) {
1116 return NGX_ERROR; 1116 return NGX_ERROR;
1117 } 1117 }
1118 } 1118 }
1119 1119
1120 sa = (struct sockaddr *) &lsopt->sockaddr; 1120 sa = &lsopt->u.sockaddr;
1121 1121
1122 switch (sa->sa_family) { 1122 switch (sa->sa_family) {
1123 1123
1124 #if (NGX_HAVE_INET6) 1124 #if (NGX_HAVE_INET6)
1125 case AF_INET6: 1125 case AF_INET6:
1126 sin6 = (struct sockaddr_in6 *) sa; 1126 sin6 = &lsopt->u.sockaddr_in6;
1127 p = sin6->sin6_port; 1127 p = sin6->sin6_port;
1128 break; 1128 break;
1129 #endif 1129 #endif
1130 1130
1131 #if (NGX_HAVE_UNIX_DOMAIN) 1131 #if (NGX_HAVE_UNIX_DOMAIN)
1133 p = 0; 1133 p = 0;
1134 break; 1134 break;
1135 #endif 1135 #endif
1136 1136
1137 default: /* AF_INET */ 1137 default: /* AF_INET */
1138 sin = (struct sockaddr_in *) sa; 1138 sin = &lsopt->u.sockaddr_in;
1139 p = sin->sin_port; 1139 p = sin->sin_port;
1140 break; 1140 break;
1141 } 1141 }
1142 1142
1143 port = cmcf->ports->elts; 1143 port = cmcf->ports->elts;
1183 /* 1183 /*
1184 * we can not compare whole sockaddr struct's as kernel 1184 * we can not compare whole sockaddr struct's as kernel
1185 * may fill some fields in inherited sockaddr struct's 1185 * may fill some fields in inherited sockaddr struct's
1186 */ 1186 */
1187 1187
1188 sa = (struct sockaddr *) &lsopt->sockaddr; 1188 sa = &lsopt->u.sockaddr;
1189 1189
1190 switch (sa->sa_family) { 1190 switch (sa->sa_family) {
1191 1191
1192 #if (NGX_HAVE_INET6) 1192 #if (NGX_HAVE_INET6)
1193 case AF_INET6: 1193 case AF_INET6:
1207 off = offsetof(struct sockaddr_in, sin_addr); 1207 off = offsetof(struct sockaddr_in, sin_addr);
1208 len = 4; 1208 len = 4;
1209 break; 1209 break;
1210 } 1210 }
1211 1211
1212 p = lsopt->sockaddr + off; 1212 p = lsopt->u.sockaddr_data + off;
1213 1213
1214 addr = port->addrs.elts; 1214 addr = port->addrs.elts;
1215 1215
1216 for (i = 0; i < port->addrs.nelts; i++) { 1216 for (i = 0; i < port->addrs.nelts; i++) {
1217 1217
1218 if (ngx_memcmp(p, (u_char *) addr[i].opt.sockaddr + off, len) != 0) { 1218 if (ngx_memcmp(p, addr[i].opt.u.sockaddr_data + off, len) != 0) {
1219 continue; 1219 continue;
1220 } 1220 }
1221 1221
1222 /* the address is already in the address list */ 1222 /* the address is already in the address list */
1223 1223
1672 { 1672 {
1673 ngx_listening_t *ls; 1673 ngx_listening_t *ls;
1674 ngx_http_core_loc_conf_t *clcf; 1674 ngx_http_core_loc_conf_t *clcf;
1675 ngx_http_core_srv_conf_t *cscf; 1675 ngx_http_core_srv_conf_t *cscf;
1676 1676
1677 ls = ngx_create_listening(cf, addr->opt.sockaddr, addr->opt.socklen); 1677 ls = ngx_create_listening(cf, &addr->opt.u.sockaddr, addr->opt.socklen);
1678 if (ls == NULL) { 1678 if (ls == NULL) {
1679 return NULL; 1679 return NULL;
1680 } 1680 }
1681 1681
1682 ls->addr_ntop = 1; 1682 ls->addr_ntop = 1;
1741 1741
1742 addrs = hport->addrs; 1742 addrs = hport->addrs;
1743 1743
1744 for (i = 0; i < hport->naddrs; i++) { 1744 for (i = 0; i < hport->naddrs; i++) {
1745 1745
1746 sin = (struct sockaddr_in *) addr[i].opt.sockaddr; 1746 sin = &addr[i].opt.u.sockaddr_in;
1747 addrs[i].addr = sin->sin_addr.s_addr; 1747 addrs[i].addr = sin->sin_addr.s_addr;
1748 addrs[i].conf.default_server = addr[i].default_server; 1748 addrs[i].conf.default_server = addr[i].default_server;
1749 #if (NGX_HTTP_SSL) 1749 #if (NGX_HTTP_SSL)
1750 addrs[i].conf.ssl = addr[i].opt.ssl; 1750 addrs[i].conf.ssl = addr[i].opt.ssl;
1751 #endif 1751 #endif
1802 1802
1803 addrs6 = hport->addrs; 1803 addrs6 = hport->addrs;
1804 1804
1805 for (i = 0; i < hport->naddrs; i++) { 1805 for (i = 0; i < hport->naddrs; i++) {
1806 1806
1807 sin6 = (struct sockaddr_in6 *) addr[i].opt.sockaddr; 1807 sin6 = &addr[i].opt.u.sockaddr_in6;
1808 addrs6[i].addr6 = sin6->sin6_addr; 1808 addrs6[i].addr6 = sin6->sin6_addr;
1809 addrs6[i].conf.default_server = addr[i].default_server; 1809 addrs6[i].conf.default_server = addr[i].default_server;
1810 #if (NGX_HTTP_SSL) 1810 #if (NGX_HTTP_SSL)
1811 addrs6[i].conf.ssl = addr[i].opt.ssl; 1811 addrs6[i].conf.ssl = addr[i].opt.ssl;
1812 #endif 1812 #endif