# HG changeset patch # User Igor Sysoev # Date 1275905651 0 # Node ID 771d28b860773de4edf8dc34a99fc71895ac4c17 # Parent d513f9d30208ad961e14acb34438cd39a71aaa4a 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" diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- 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_ p = r->uri.data + r->uri.len - 1; - if (*p == '.' || *p == ' ') { - - while (--p > r->uri.data && (*p == '.' || *p == ' ')) { - /* void */ + while (p > r->uri.data) { + + if (*p == ' ') { + p--; + continue; + } + + 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 --- 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, 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 --- a/src/os/win32/ngx_win32_config.h +++ b/src/os/win32/ngx_win32_config.h @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef __WATCOMC__ #define _TIME_T_DEFINED diff --git a/src/os/win32/ngx_win32_init.c b/src/os/win32/ngx_win32_init.c --- 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 */