Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2013-09-23 19:37:13 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2013-09-23 19:37:13 +0400
commite11584164f787095e99e6759f2f6e16e24683855 (patch)
treea09603e9e0a7e702f853027ef71a3b0772098343 /src/os/win32
parentd2ef70e97acbda42204d589d0886be88314016c2 (diff)
Added ngx_filename_cmp() with "/" sorted to the left.
This patch fixes incorrect handling of auto redirect in configurations like: location /0 { } location /a- { } location /a/ { proxy_pass ... } With previously used sorting, this resulted in the following locations tree (as "-" is less than "/"): "/a-" "/0" "/a/" and a request to "/a" didn't match "/a/" with auto_redirect, as it didn't traverse relevant tree node during lookup (it tested "/a-", then "/0", and then falled back to null location). To preserve locale use for non-ASCII characters on case-insensetive systems, libc's tolower() used.
Diffstat (limited to 'src/os/win32')
-rw-r--r--src/os/win32/ngx_files.h5
-rw-r--r--src/os/win32/ngx_win32_config.h6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/os/win32/ngx_files.h b/src/os/win32/ngx_files.h
index a4624738f..08e5dc67e 100644
--- a/src/os/win32/ngx_files.h
+++ b/src/os/win32/ngx_files.h
@@ -172,11 +172,6 @@ ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm);
void ngx_close_file_mapping(ngx_file_mapping_t *fm);
-#define NGX_HAVE_CASELESS_FILESYSTEM 1
-
-#define ngx_filename_cmp(s1, s2, n) _strnicmp((char *) s1, (char *) s2, n)
-
-
u_char *ngx_realpath(u_char *path, u_char *resolved);
#define ngx_realpath_n ""
#define ngx_getcwd(buf, size) GetCurrentDirectory(size, (char *) buf)
diff --git a/src/os/win32/ngx_win32_config.h b/src/os/win32/ngx_win32_config.h
index 67105f1af..fcbb30845 100644
--- a/src/os/win32/ngx_win32_config.h
+++ b/src/os/win32/ngx_win32_config.h
@@ -45,6 +45,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <ctype.h>
#include <locale.h>
#ifdef __WATCOMC__
@@ -123,7 +124,6 @@ typedef unsigned __int32 uint32_t;
typedef __int32 int32_t;
typedef unsigned __int16 uint16_t;
#define ngx_libc_cdecl __cdecl
-#define _strnicmp strnicmp
#else /* __WATCOMC__ */
typedef unsigned int uint32_t;
@@ -196,6 +196,10 @@ typedef int sig_atomic_t;
#define NGX_HAVE_INHERITED_NONBLOCK 1
#endif
+#ifndef NGX_HAVE_CASELESS_FILESYSTEM
+#define NGX_HAVE_CASELESS_FILESYSTEM 1
+#endif
+
#ifndef NGX_HAVE_WIN32_TRANSMITPACKETS
#define NGX_HAVE_WIN32_TRANSMITPACKETS 1
#define NGX_HAVE_WIN32_TRANSMITFILE 0