diff 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
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1220,10 +1220,7 @@ ngx_http_core_try_files_phase(ngx_http_r
             ngx_memcpy(p, name, path.len);
         }
 
-        if (ngx_http_set_exten(r) != NGX_OK) {
-            ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
-            return NGX_OK;
-        }
+        ngx_http_set_exten(r);
 
         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                        "try file uri: \"%V\"", &r->uri);
@@ -1633,7 +1630,7 @@ ngx_http_set_content_type(ngx_http_reque
 }
 
 
-ngx_int_t
+void
 ngx_http_set_exten(ngx_http_request_t *r)
 {
     ngx_int_t  i;
@@ -1647,14 +1644,14 @@ ngx_http_set_exten(ngx_http_request_t *r
             r->exten.len = r->uri.len - i - 1;
             r->exten.data = &r->uri.data[i + 1];
 
-            break;
+            return;
 
         } else if (r->uri.data[i] == '/') {
-            break;
+            return;
         }
     }
 
-    return NGX_OK;
+    return;
 }
 
 
@@ -2079,9 +2076,7 @@ ngx_http_subrequest(ngx_http_request_t *
     sr->method_name = ngx_http_core_get_method;
     sr->http_protocol = r->http_protocol;
 
-    if (ngx_http_set_exten(sr) != NGX_OK) {
-        return NGX_ERROR;
-    }
+    ngx_http_set_exten(sr);
 
     sr->main = r->main;
     sr->parent = r;
@@ -2160,10 +2155,7 @@ ngx_http_internal_redirect(ngx_http_requ
     ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "internal redirect: \"%V?%V\"", uri, &r->args);
 
-    if (ngx_http_set_exten(r) != NGX_OK) {
-        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
-        return NGX_DONE;
-    }
+    ngx_http_set_exten(r);
 
     /* clear the modules contexts */
     ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
@@ -2566,6 +2558,10 @@ ngx_http_core_regex_location(ngx_conf_t 
     err.len = NGX_MAX_CONF_ERRSTR;
     err.data = errstr;
 
+#if (NGX_HAVE_CASELESS_FILESYSTEM)
+    caseless = 1;
+#endif
+
     clcf->regex = ngx_regex_compile(regex, caseless ? NGX_REGEX_CASELESS: 0,
                                     cf->pool, &err);