comparison src/http/modules/ngx_http_index_handler.c @ 186:c1f3a3c7c5db

nginx-0.0.1-2003-11-17-00:49:42 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 16 Nov 2003 21:49:42 +0000
parents d5f50cefc322
children a65b630b3a66
comparison
equal deleted inserted replaced
185:d5f50cefc322 186:c1f3a3c7c5db
200 r->path.data[r->path.len - 1] = '\0'; 200 r->path.data[r->path.len - 1] = '\0';
201 r->path.data[r->path.len] = '\0'; 201 r->path.data[r->path.len] = '\0';
202 202
203 ngx_log_debug(r->connection->log, "IS_DIR: %s" _ r->path.data); 203 ngx_log_debug(r->connection->log, "IS_DIR: %s" _ r->path.data);
204 204
205 if (ngx_file_type(r->path.data, &r->file.info) == -1) { 205 if (ngx_file_info(r->path.data, &r->file.info) == -1) {
206 206
207 err = ngx_errno; 207 err = ngx_errno;
208 208
209 if (err == NGX_ENOENT) { 209 if (err == NGX_ENOENT) {
210 r->path.data[r->path.len - 1] = '/'; 210 r->path.data[r->path.len - 1] = '/';
211 return ngx_http_index_error(r, ctx, err); 211 return ngx_http_index_error(r, ctx, err);
212 } 212 }
213 213
214 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err, 214 ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
215 ngx_file_type_n " %s failed", r->path.data); 215 ngx_file_info_n " %s failed", r->path.data);
216 216
217 return NGX_HTTP_INTERNAL_SERVER_ERROR; 217 return NGX_HTTP_INTERNAL_SERVER_ERROR;
218 } 218 }
219 219
220 r->path.data[r->path.len - 1] = '/'; 220 r->path.data[r->path.len - 1] = '/';
221 221
222 if (ngx_is_dir((&r->file.info))) { 222 if (ngx_is_dir(&r->file.info)) {
223 return NGX_OK; 223 return NGX_OK;
224 } 224 }
225 225
226 /* THINK: not reached ??? */ 226 /* THINK: not reached ??? */
227 return ngx_http_index_error(r, ctx, 0); 227 return ngx_http_index_error(r, ctx, 0);