comparison src/http/ngx_http_core_module.c @ 500:ed3d382670c7 NGINX_0_7_62

nginx 0.7.62 *) Security: a segmentation fault might occur in worker process while specially crafted request handling. Thanks to Chris Ries. *) Feature: the $upstream_cache_status variable. *) Bugfix: an expired cached response might stick in the "UPDATING" state. *) Bugfix: a segmentation fault might occur in worker process, if error_log was set to info or debug level. Thanks to Sergey Bochenkov. *) Bugfix: in handling FastCGI headers split in records. *) Bugfix: XSLT filter may fail with message "not well formed XML document" for valid XML document. Thanks to Kuramoto Eiji. *) Bugfix: now in MacOSX, Cygwin, and nginx/Windows locations given by a regular expression are always tested in case insensitive mode. *) Bugfix: now nginx/Windows ignores trailing dots in URI. Thanks to Hugo Leisink. *) Bugfix: name of file specified in --conf-path was not honored during installation; the bug had appeared in 0.6.6. Thanks to Maxim Dounin. *) Bugfix: a 500 error code was returned for invalid login/password while HTTP Basic authentication on Windows.
author Igor Sysoev <http://sysoev.ru>
date Mon, 14 Sep 2009 00:00:00 +0400
parents 116d5de7cbb6
children 89dc5654117c
comparison
equal deleted inserted replaced
499:f2c782e5161f 500:ed3d382670c7
1218 1218
1219 p = ngx_copy(r->uri.data, clcf->name.data, alias); 1219 p = ngx_copy(r->uri.data, clcf->name.data, alias);
1220 ngx_memcpy(p, name, path.len); 1220 ngx_memcpy(p, name, path.len);
1221 } 1221 }
1222 1222
1223 if (ngx_http_set_exten(r) != NGX_OK) { 1223 ngx_http_set_exten(r);
1224 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
1225 return NGX_OK;
1226 }
1227 1224
1228 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1225 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1229 "try file uri: \"%V\"", &r->uri); 1226 "try file uri: \"%V\"", &r->uri);
1230 1227
1231 r->phase_handler++; 1228 r->phase_handler++;
1631 1628
1632 return NGX_OK; 1629 return NGX_OK;
1633 } 1630 }
1634 1631
1635 1632
1636 ngx_int_t 1633 void
1637 ngx_http_set_exten(ngx_http_request_t *r) 1634 ngx_http_set_exten(ngx_http_request_t *r)
1638 { 1635 {
1639 ngx_int_t i; 1636 ngx_int_t i;
1640 1637
1641 r->exten.len = 0; 1638 r->exten.len = 0;
1645 if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') { 1642 if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
1646 1643
1647 r->exten.len = r->uri.len - i - 1; 1644 r->exten.len = r->uri.len - i - 1;
1648 r->exten.data = &r->uri.data[i + 1]; 1645 r->exten.data = &r->uri.data[i + 1];
1649 1646
1650 break; 1647 return;
1651 1648
1652 } else if (r->uri.data[i] == '/') { 1649 } else if (r->uri.data[i] == '/') {
1653 break; 1650 return;
1654 } 1651 }
1655 } 1652 }
1656 1653
1657 return NGX_OK; 1654 return;
1658 } 1655 }
1659 1656
1660 1657
1661 ngx_int_t 1658 ngx_int_t
1662 ngx_http_send_header(ngx_http_request_t *r) 1659 ngx_http_send_header(ngx_http_request_t *r)
2077 2074
2078 sr->unparsed_uri = r->unparsed_uri; 2075 sr->unparsed_uri = r->unparsed_uri;
2079 sr->method_name = ngx_http_core_get_method; 2076 sr->method_name = ngx_http_core_get_method;
2080 sr->http_protocol = r->http_protocol; 2077 sr->http_protocol = r->http_protocol;
2081 2078
2082 if (ngx_http_set_exten(sr) != NGX_OK) { 2079 ngx_http_set_exten(sr);
2083 return NGX_ERROR;
2084 }
2085 2080
2086 sr->main = r->main; 2081 sr->main = r->main;
2087 sr->parent = r; 2082 sr->parent = r;
2088 sr->post_subrequest = ps; 2083 sr->post_subrequest = ps;
2089 sr->read_event_handler = ngx_http_request_empty_handler; 2084 sr->read_event_handler = ngx_http_request_empty_handler;
2158 } 2153 }
2159 2154
2160 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 2155 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
2161 "internal redirect: \"%V?%V\"", uri, &r->args); 2156 "internal redirect: \"%V?%V\"", uri, &r->args);
2162 2157
2163 if (ngx_http_set_exten(r) != NGX_OK) { 2158 ngx_http_set_exten(r);
2164 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
2165 return NGX_DONE;
2166 }
2167 2159
2168 /* clear the modules contexts */ 2160 /* clear the modules contexts */
2169 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module); 2161 ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
2170 2162
2171 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); 2163 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
2563 ngx_str_t err; 2555 ngx_str_t err;
2564 u_char errstr[NGX_MAX_CONF_ERRSTR]; 2556 u_char errstr[NGX_MAX_CONF_ERRSTR];
2565 2557
2566 err.len = NGX_MAX_CONF_ERRSTR; 2558 err.len = NGX_MAX_CONF_ERRSTR;
2567 err.data = errstr; 2559 err.data = errstr;
2560
2561 #if (NGX_HAVE_CASELESS_FILESYSTEM)
2562 caseless = 1;
2563 #endif
2568 2564
2569 clcf->regex = ngx_regex_compile(regex, caseless ? NGX_REGEX_CASELESS: 0, 2565 clcf->regex = ngx_regex_compile(regex, caseless ? NGX_REGEX_CASELESS: 0,
2570 cf->pool, &err); 2566 cf->pool, &err);
2571 2567
2572 if (clcf->regex == NULL) { 2568 if (clcf->regex == NULL) {