Mercurial > hg > nginx-quic
comparison src/core/ngx_string.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 | 814541b2ec23 |
children | a602e1006579 |
comparison
equal
deleted
inserted
replaced
5388:fbaae7d1c033 | 5389:72e31d88defa |
---|---|
165 | 165 |
166 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); | 166 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); |
167 ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n); | 167 ngx_int_t ngx_rstrncasecmp(u_char *s1, u_char *s2, size_t n); |
168 ngx_int_t ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2); | 168 ngx_int_t ngx_memn2cmp(u_char *s1, u_char *s2, size_t n1, size_t n2); |
169 ngx_int_t ngx_dns_strcmp(u_char *s1, u_char *s2); | 169 ngx_int_t ngx_dns_strcmp(u_char *s1, u_char *s2); |
170 ngx_int_t ngx_filename_cmp(u_char *s1, u_char *s2, size_t n); | |
170 | 171 |
171 ngx_int_t ngx_atoi(u_char *line, size_t n); | 172 ngx_int_t ngx_atoi(u_char *line, size_t n); |
172 ngx_int_t ngx_atofp(u_char *line, size_t n, size_t point); | 173 ngx_int_t ngx_atofp(u_char *line, size_t n, size_t point); |
173 ssize_t ngx_atosz(u_char *line, size_t n); | 174 ssize_t ngx_atosz(u_char *line, size_t n); |
174 off_t ngx_atoof(u_char *line, size_t n); | 175 off_t ngx_atoof(u_char *line, size_t n); |