aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_static_handler.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-06-02 15:24:30 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-06-02 15:24:30 +0000
commit7578ec9df43bbb31db5291f1b76359d10900a679 (patch)
tree87d7b3cb729c0e07b21d52737fd76e12a0c17d72 /src/http/modules/ngx_http_static_handler.c
parentaa3436c04c222d57498bfa34c9fdec50f07fd08d (diff)
downloadnginx-7578ec9df43bbb31db5291f1b76359d10900a679.tar.gz
nginx-7578ec9df43bbb31db5291f1b76359d10900a679.zip
nginx-0.0.1-2003-06-02-19:24:30 import
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r--src/http/modules/ngx_http_static_handler.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c
index bc88fc920..8ea6a0a00 100644
--- a/src/http/modules/ngx_http_static_handler.c
+++ b/src/http/modules/ngx_http_static_handler.c
@@ -2,10 +2,6 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
-#include <ngx_http_config.h>
-#include <ngx_http_core_module.h>
-#include <ngx_http_output_filter.h>
-
int ngx_http_static_handler(ngx_http_request_t *r)
@@ -32,7 +28,8 @@ int ngx_http_static_handler(ngx_http_request_t *r)
ctx->action = "sending response";
if (r->file.fd == NGX_INVALID_FILE) {
- r->file.fd = ngx_open_file(r->file.name.data, NGX_FILE_RDONLY);
+ r->file.fd = ngx_open_file(r->file.name.data,
+ NGX_FILE_RDONLY, NGX_FILE_OPEN);
if (r->file.fd == NGX_INVALID_FILE) {
err = ngx_errno;
@@ -129,6 +126,10 @@ int ngx_http_static_handler(ngx_http_request_t *r)
rc = ngx_http_send_header(r);
+ if (rc == NGX_ERROR || rc > NGX_OK) {
+ ngx_http_finalize_request(r, rc);
+ return NGX_OK;
+ }
if (r->header_only) {
if (rc == NGX_AGAIN) {