From 98e044cd86c9b4c6c4eaa0ca8008832d1dcc9726 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 7 Jun 2010 10:14:11 +0000 Subject: 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" --- src/http/ngx_http_request.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'src/http/ngx_http_request.c') diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index c32f4c6b1..5710c699f 100644 --- 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_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 -- cgit