comparison src/os/unix/ngx_posix_config.h @ 5389:72e31d88defa

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 23 Sep 2013 19:37:13 +0400
parents 489839d07b38
children a88e309f839b
comparison
equal deleted inserted replaced
5388:fbaae7d1c033 5389:72e31d88defa
37 #endif 37 #endif
38 #include <stdarg.h> 38 #include <stdarg.h>
39 #include <stddef.h> /* offsetof() */ 39 #include <stddef.h> /* offsetof() */
40 #include <stdio.h> 40 #include <stdio.h>
41 #include <stdlib.h> 41 #include <stdlib.h>
42 #include <ctype.h>
42 #include <errno.h> 43 #include <errno.h>
43 #include <string.h> 44 #include <string.h>
44 #include <signal.h> 45 #include <signal.h>
45 #include <pwd.h> 46 #include <pwd.h>
46 #include <grp.h> 47 #include <grp.h>