From 7578ec9df43bbb31db5291f1b76359d10900a679 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 2 Jun 2003 15:24:30 +0000 Subject: nginx-0.0.1-2003-06-02-19:24:30 import --- src/http/modules/ngx_http_static_handler.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/http/modules/ngx_http_static_handler.c') 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 #include #include -#include -#include -#include - 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) { -- cgit