comparison src/http/ngx_http_header_filter_module.c @ 1811:0d9c6fe7502b

axe useless r->server_name
author Igor Sysoev <igor@sysoev.ru>
date Sun, 30 Dec 2007 08:15:27 +0000
parents d457a1576532
children b9de93d804ea 9f15e5f8ff9e
comparison
equal deleted inserted replaced
1810:755e09d5c271 1811:0d9c6fe7502b
158 ngx_uint_t status, i; 158 ngx_uint_t status, i;
159 ngx_chain_t out; 159 ngx_chain_t out;
160 ngx_list_part_t *part; 160 ngx_list_part_t *part;
161 ngx_table_elt_t *header; 161 ngx_table_elt_t *header;
162 ngx_http_core_loc_conf_t *clcf; 162 ngx_http_core_loc_conf_t *clcf;
163 ngx_http_core_srv_conf_t *cscf;
163 /* AF_INET only */ 164 /* AF_INET only */
164 u_char addr[INET_ADDRSTRLEN]; 165 u_char addr[INET_ADDRSTRLEN];
165 166
166 r->header_sent = 1; 167 r->header_sent = 1;
167 168
280 && r->headers_out.location->value.data[0] == '/') 281 && r->headers_out.location->value.data[0] == '/')
281 { 282 {
282 r->headers_out.location->hash = 0; 283 r->headers_out.location->hash = 0;
283 284
284 if (clcf->server_name_in_redirect) { 285 if (clcf->server_name_in_redirect) {
285 host = r->server_name; 286 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
287 host = cscf->server_name;
286 288
287 } else if (r->headers_in.host) { 289 } else if (r->headers_in.host) {
288 host.len = r->headers_in.host_name_len; 290 host.len = r->headers_in.host_name_len;
289 host.data = r->headers_in.host->value.data; 291 host.data = r->headers_in.host->value.data;
290 292