comparison src/http/modules/ngx_http_index_module.c @ 665:0b460e61bdcd default tip

Merge with nginx 1.0.0.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 25 Apr 2011 04:22:17 +0400
parents ff463db0be31
children
comparison
equal deleted inserted replaced
572:06419a2298a9 665:0b460e61bdcd
114 114
115 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) { 115 if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
116 return NGX_DECLINED; 116 return NGX_DECLINED;
117 } 117 }
118 118
119 if (r->zero_in_uri) {
120 return NGX_DECLINED;
121 }
122
123 ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module); 119 ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
124 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 120 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
125 121
126 allocated = 0; 122 allocated = 0;
127 root = 0; 123 root = 0;
203 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 199 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
204 "open index \"%V\"", &path); 200 "open index \"%V\"", &path);
205 201
206 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 202 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
207 203
204 of.read_ahead = clcf->read_ahead;
208 of.directio = clcf->directio; 205 of.directio = clcf->directio;
209 of.valid = clcf->open_file_cache_valid; 206 of.valid = clcf->open_file_cache_valid;
210 of.min_uses = clcf->open_file_cache_min_uses; 207 of.min_uses = clcf->open_file_cache_min_uses;
211 of.test_only = 1; 208 of.test_only = 1;
212 of.errors = clcf->open_file_cache_errors; 209 of.errors = clcf->open_file_cache_errors;
220 217
221 if (of.err == 0) { 218 if (of.err == 0) {
222 return NGX_HTTP_INTERNAL_SERVER_ERROR; 219 return NGX_HTTP_INTERNAL_SERVER_ERROR;
223 } 220 }
224 221
225 if (of.err == NGX_ENOTDIR || of.err == NGX_EACCES) { 222 if (of.err == NGX_ENOTDIR
223 || of.err == NGX_ENAMETOOLONG
224 || of.err == NGX_EACCES)
225 {
226 return ngx_http_index_error(r, clcf, path.data, of.err); 226 return ngx_http_index_error(r, clcf, path.data, of.err);
227 } 227 }
228 228
229 if (!dir_tested) { 229 if (!dir_tested) {
230 rc = ngx_http_index_test_dir(r, clcf, path.data, name - 1); 230 rc = ngx_http_index_test_dir(r, clcf, path.data, name - 1);