diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-01-10 17:45:47 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-01-10 17:45:47 +0000 |
commit | e79c6ac7b271cab208cd3295a833e4d9c8b9460b (patch) | |
tree | b3264c91093d2477205df21ad5e9f5a09fd2a878 /src/http/ngx_http_core_module.c | |
parent | b2620634c5c395f227a98837f46e1eaf6b86963c (diff) | |
download | nginx-e79c6ac7b271cab208cd3295a833e4d9c8b9460b.tar.gz nginx-e79c6ac7b271cab208cd3295a833e4d9c8b9460b.zip |
nginx-0.0.1-2003-01-10-20:45:47 import
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r-- | src/http/ngx_http_core_module.c | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index dd0209f45..575312a76 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -206,10 +206,15 @@ ngx_log_debug(r->connection->log, "trans: %s" _ lcf[i]->name.data); "ngx_http_core_translate_handler: " ngx_file_type_n " %s failed", r->file.name.data); - if (err == ERROR_FILE_NOT_FOUND) { + if (err == NGX_ENOENT) { return NGX_HTTP_NOT_FOUND; + } else if (err == ERROR_PATH_NOT_FOUND) { return NGX_HTTP_NOT_FOUND; + + } else if (err == NGX_EACCESS) { + return NGX_HTTP_FORBIDDEN; + } else { return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -236,6 +241,9 @@ ngx_log_debug(r->connection->log, "trans: %s" _ lcf[i]->name.data); } else if (err == NGX_ENOTDIR) { return NGX_HTTP_NOT_FOUND; #endif + } else if (err == NGX_EACCESS) { + return NGX_HTTP_FORBIDDEN; + } else { return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -296,8 +304,7 @@ ngx_log_debug(r->connection->log, "trans: %s" _ lcf[i]->name.data); static int ngx_http_core_index_handler(ngx_http_request_t *r) { - int i, rc; - ngx_err_t err; + int i, rc; ngx_http_handler_pt *h; h = (ngx_http_handler_pt *) ngx_http_index_handlers.elts; @@ -309,44 +316,7 @@ static int ngx_http_core_index_handler(ngx_http_request_t *r) } } -#if (WIN32) - - if (r->path_not_found) { - return NGX_HTTP_NOT_FOUND; - - } else { - return NGX_HTTP_FORBIDDEN; - } - -#else - - if (r->path_not_found) { - return NGX_HTTP_NOT_FOUND; - } - - r->path.data[r->path.len] = '\0'; - if (stat(r->path.data, &r->file.info) == -1) { - - err = ngx_errno; - if (err == NGX_ENOENT) { - return NGX_HTTP_NOT_FOUND; - } - - ngx_log_error(NGX_LOG_ERR, r->connection->log, err, - "ngx_http_core_index_handler: " - "stat() %s failed", r->path.data); - - return NGX_HTTP_INTERNAL_SERVER_ERROR; - } - - if (ngx_is_dir(r->file.info)) { - return NGX_HTTP_FORBIDDEN; - - } else { - return NGX_HTTP_NOT_FOUND; - } - -#endif + return NGX_HTTP_FORBIDDEN; } |