diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-09 07:00:45 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-09 07:00:45 +0000 |
commit | 1342d9cc29de7b6509a44a49cd66d1038d1e6d26 (patch) | |
tree | 618ccc0244627bece991abd6a49b354b417e1a21 /src/http/modules/ngx_http_static_handler.c | |
parent | 3ae32483cd9315aef5066e2a06411e9ffb8a5560 (diff) | |
download | nginx-1342d9cc29de7b6509a44a49cd66d1038d1e6d26.tar.gz nginx-1342d9cc29de7b6509a44a49cd66d1038d1e6d26.zip |
nginx-0.0.1-2003-10-09-11:00:45 import
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r-- | src/http/modules/ngx_http_static_handler.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c index 8ea6a0a00..784f3de4d 100644 --- a/src/http/modules/ngx_http_static_handler.c +++ b/src/http/modules/ngx_http_static_handler.c @@ -118,6 +118,7 @@ int ngx_http_static_handler(ngx_http_request_t *r) } /* we need to allocate all before the header would be sent */ + ngx_test_null(h, ngx_pcalloc(r->pool, sizeof(ngx_hunk_t)), NGX_HTTP_INTERNAL_SERVER_ERROR); @@ -132,18 +133,28 @@ int ngx_http_static_handler(ngx_http_request_t *r) } if (r->header_only) { + ngx_http_finalize_request(r, rc); + +#if 0 if (rc == NGX_AGAIN) { ngx_http_set_write_handler(r); } else { ngx_http_finalize_request(r, 0); } +#endif return NGX_OK; } - h->type = NGX_HUNK_FILE|NGX_HUNK_LAST; +#if 0 + h->type = r->main ? NGX_HUNK_FILE : NGX_HUNK_FILE|NGX_HUNK_LAST; +#else + h->type = NGX_HUNK_FILE; +#endif + + h->file_pos = 0; h->file_last = ngx_file_size(r->file.info); @@ -152,6 +163,9 @@ int ngx_http_static_handler(ngx_http_request_t *r) rc = ngx_http_output_filter(r, h); + ngx_http_finalize_request(r, rc); + +#if 0 if (r->main == NULL) { if (rc == NGX_AGAIN) { ngx_http_set_write_handler(r); @@ -160,6 +174,7 @@ int ngx_http_static_handler(ngx_http_request_t *r) ngx_http_finalize_request(r, 0); } } +#endif return NGX_OK; } |