aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_static_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-02 22:56:18 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-02 22:56:18 +0000
commit659774979feb9741a441505e26774b35830fd4ca (patch)
tree596059bbe20959ad54cbfde8bcdf24cd7f9e9f83 /src/http/modules/ngx_http_static_handler.c
parentfe0f5cc6e1e48412235ae91c2f71ec2ec9110a60 (diff)
downloadnginx-659774979feb9741a441505e26774b35830fd4ca.tar.gz
nginx-659774979feb9741a441505e26774b35830fd4ca.zip
nginx-0.0.1-2003-11-03-01:56:18 import
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r--src/http/modules/ngx_http_static_handler.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index 3b87923ed..ad2669be6 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -39,6 +39,7 @@ ngx_module_t ngx_http_static_module = {
int ngx_http_static_translate_handler(ngx_http_request_t *r)
{
+ int rc, level;
char *location, *last;
ngx_err_t err;
ngx_http_core_loc_conf_t *clcf;
@@ -116,18 +117,24 @@ ngx_log_debug(r->connection->log, "HTTP filename: '%s'" _ r->file.name.data);
if (r->file.fd == NGX_INVALID_FILE) {
err = ngx_errno;
- ngx_log_error(NGX_LOG_ERR, r->connection->log, ngx_errno,
- ngx_open_file_n " \"%s\" failed", r->file.name.data);
if (err == NGX_ENOENT || err == NGX_ENOTDIR) {
- return NGX_HTTP_NOT_FOUND;
+ level = NGX_LOG_ERR;
+ rc = NGX_HTTP_NOT_FOUND;
} else if (err == NGX_EACCES) {
- return NGX_HTTP_FORBIDDEN;
+ level = NGX_LOG_ERR;
+ rc = NGX_HTTP_FORBIDDEN;
} else {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ level = NGX_LOG_CRIT;
+ rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
}
+
+ ngx_log_error(level, r->connection->log, ngx_errno,
+ ngx_open_file_n " \"%s\" failed", r->file.name.data);
+
+ return rc;
}
ngx_log_debug(r->connection->log, "FILE: %d" _ r->file.fd);