comparison src/http/modules/ngx_http_static_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
64 64
65 if (r->uri.data[r->uri.len - 1] == '/') { 65 if (r->uri.data[r->uri.len - 1] == '/') {
66 return NGX_DECLINED; 66 return NGX_DECLINED;
67 } 67 }
68 68
69 if (r->zero_in_uri) {
70 return NGX_DECLINED;
71 }
72
73 log = r->connection->log; 69 log = r->connection->log;
74 70
75 /* 71 /*
76 * ngx_http_map_uri_to_path() allocates memory for terminating '\0' 72 * ngx_http_map_uri_to_path() allocates memory for terminating '\0'
77 * so we do not need to reserve memory for '/' for possible redirect 73 * so we do not need to reserve memory for '/' for possible redirect
89 85
90 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 86 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
91 87
92 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 88 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
93 89
90 of.read_ahead = clcf->read_ahead;
94 of.directio = clcf->directio; 91 of.directio = clcf->directio;
95 of.valid = clcf->open_file_cache_valid; 92 of.valid = clcf->open_file_cache_valid;
96 of.min_uses = clcf->open_file_cache_min_uses; 93 of.min_uses = clcf->open_file_cache_min_uses;
97 of.errors = clcf->open_file_cache_errors; 94 of.errors = clcf->open_file_cache_errors;
98 of.events = clcf->open_file_cache_events; 95 of.events = clcf->open_file_cache_events;
186 } 183 }
187 184
188 #if !(NGX_WIN32) /* the not regular files are probably Unix specific */ 185 #if !(NGX_WIN32) /* the not regular files are probably Unix specific */
189 186
190 if (!of.is_file) { 187 if (!of.is_file) {
191 ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, 188 ngx_log_error(NGX_LOG_CRIT, log, 0,
192 "\"%s\" is not a regular file", path.data); 189 "\"%s\" is not a regular file", path.data);
193 190
194 return NGX_HTTP_NOT_FOUND; 191 return NGX_HTTP_NOT_FOUND;
195 } 192 }
196 193