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"
This commit is contained in:
Igor Sysoev 2010-06-07 10:14:11 +00:00
parent 5ff6279efa
commit 54f0e8ae0a
4 changed files with 24 additions and 5 deletions

View 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

View 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;
}

View File

@ -36,6 +36,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <locale.h>
#ifdef __WATCOMC__
#define _TIME_T_DEFINED

View 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 */