comparison src/http/modules/ngx_http_index_handler.c @ 74:17ab1af8c3dd

nginx-0.0.1-2003-04-11-20:01:14 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 11 Apr 2003 16:01:14 +0000
parents 59229033ae93
children 674d333f4296
comparison
equal deleted inserted replaced
73:4534060fde92 74:17ab1af8c3dd
56 56
57 /* 57 /*
58 Try to open first index file before the test of the directory existence 58 Try to open first index file before the test of the directory existence
59 because the valid requests should be many more then invalid ones. 59 because the valid requests should be many more then invalid ones.
60 If open() failed then stat() should be more quickly because some data 60 If open() failed then stat() should be more quickly because some data
61 is already cached in the kernel. Besides Win32 has ERROR_PATH_NOT_FOUND 61 is already cached in the kernel.
62 and Unix has ENOTDIR error (although it less helpfull). 62 Besides Win32 has ERROR_PATH_NOT_FOUND (NGX_ENOTDIR) and
63 Unix has ENOTDIR error (although it less helpfull).
63 */ 64 */
64 65
65 int ngx_http_index_handler(ngx_http_request_t *r) 66 int ngx_http_index_handler(ngx_http_request_t *r)
66 { 67 {
67 int i, rc, test_dir; 68 int i, rc, test_dir;
108 err = ngx_errno; 109 err = ngx_errno;
109 110
110 ngx_log_error(NGX_LOG_DEBUG, r->connection->log, err, 111 ngx_log_error(NGX_LOG_DEBUG, r->connection->log, err,
111 "DEBUG: " ngx_open_file_n " %s failed", name); 112 "DEBUG: " ngx_open_file_n " %s failed", name);
112 113
113 #if (WIN32)
114 if (err == ERROR_PATH_NOT_FOUND) {
115 #else
116 if (err == NGX_ENOTDIR) { 114 if (err == NGX_ENOTDIR) {
117 #endif
118 r->path_not_found = 1; 115 r->path_not_found = 1;
119 116
120 } else if (err == NGX_EACCES) { 117 } else if (err == NGX_EACCES) {
121 r->path_err = err; 118 r->path_err = err;
122 return NGX_HTTP_FORBIDDEN; 119 return NGX_HTTP_FORBIDDEN;