]> git.kaiwu.me - nginx.git/commitdiff
merge r3459, r3571:
authorIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jun 2010 10:14:11 +0000 (10:14 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 7 Jun 2010 10:14:11 +0000 (10:14 +0000)
Win32 fixes:

*) compare long file names in case-insensitive mode,
   the bug had been introduced in r3436
*) test default NTFS stream "::$DATA"

src/http/ngx_http_request.c
src/os/win32/ngx_files.c
src/os/win32/ngx_win32_config.h
src/os/win32/ngx_win32_init.c

index c32f4c6b1c8ec5c05a0edc18f3f5791548db6090..5710c699f2976d5db3f2ecdf286eee4ff899f2a7 100644 (file)
@@ -784,16 +784,31 @@ ngx_http_process_request_line(ngx_event_t *rev)
 
             p = r->uri.data + r->uri.len - 1;
 
-            if (*p == '.' || *p == ' ') {
+            while (p > r->uri.data) {
 
-                while (--p > r->uri.data && (*p == '.' || *p == ' ')) {
-                    /* void */
+                if (*p == ' ') {
+                    p--;
+                    continue;
                 }
 
-                r->uri.len = p + 1 - r->uri.data;
+                if (*p == '.') {
+                    p--;
+                    continue;
+                }
 
+                if (ngx_strncasecmp(p - 6, (u_char *) "::$data", 7) == 0) {
+                    p -= 7;
+                    continue;
+                }
+
+                break;
+            }
+
+            if (p != r->uri.data + r->uri.len - 1) {
+                r->uri.len = p + 1 - r->uri.data;
                 ngx_http_set_exten(r);
             }
+
             }
 #endif
 
index 24f744399e490b84c9da4e68255dae523b58fd97..45e445660bed49059a110a05e1f4cd985e3e194c 100644 (file)
@@ -48,7 +48,7 @@ ngx_open_file(u_char *name, u_long mode, u_long create, u_long access)
             goto failed;
         }
 
-        if (n != len - 1 || ngx_memcmp(u, lu, n) != 0) {
+        if (n != len - 1 || _wcsicmp(u, lu) != 0) {
             ngx_set_errno(NGX_ENOENT);
             goto failed;
         }
index d35b448ba9e1da44232d5e89855db71f14cb38af..0dcba98cfd9b1e7382f33b39e2df99bf2e49808c 100644 (file)
@@ -36,6 +36,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <locale.h>
 
 #ifdef __WATCOMC__
 #define _TIME_T_DEFINED
index 0924c3c7073eeadb39fadd41d6679e83a695982b..3b22358aa13e3c9bc8e4374ce28358c65ea1a06f 100644 (file)
@@ -114,6 +114,9 @@ ngx_os_init(ngx_log_t *log)
 
     for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ }
 
+    /* delete default "C" locale for _wcsicmp() */
+    setlocale(LC_ALL, "");
+
 
     /* init Winsock */