diff options
author | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 10:14:11 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2010-06-07 10:14:11 +0000 |
commit | 98e044cd86c9b4c6c4eaa0ca8008832d1dcc9726 (patch) | |
tree | a76320fb92fe38ce94813f06e2c10430171c43db | |
parent | 49ab49ec551a103829680fce7f3e19a363c7a590 (diff) | |
download | nginx-98e044cd86c9b4c6c4eaa0ca8008832d1dcc9726.tar.gz |
merge r3459, r3571:
Win32 fixes:
*) compare long file names in case-insensitive mode,
the bug had been introduced in r3436
*) test default NTFS stream "::$DATA"
-rw-r--r-- | src/http/ngx_http_request.c | 23 | ||||
-rw-r--r-- | src/os/win32/ngx_files.c | 2 | ||||
-rw-r--r-- | src/os/win32/ngx_win32_config.h | 1 | ||||
-rw-r--r-- | src/os/win32/ngx_win32_init.c | 3 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index c32f4c6b1..5710c699f 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -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 diff --git a/src/os/win32/ngx_files.c b/src/os/win32/ngx_files.c index 24f744399..45e445660 100644 --- a/src/os/win32/ngx_files.c +++ b/src/os/win32/ngx_files.c @@ -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; } diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h index d35b448ba..0dcba98cf 100644 --- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -36,6 +36,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdarg.h> +#include <locale.h> #ifdef __WATCOMC__ #define _TIME_T_DEFINED diff --git a/src/os/win32/ngx_win32_init.c b/src/os/win32/ngx_win32_init.c index 0924c3c70..3b22358aa 100644 --- a/src/os/win32/ngx_win32_init.c +++ b/src/os/win32/ngx_win32_init.c @@ -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 */ |