Mercurial > hg > nginx
diff src/http/modules/ngx_http_static_handler.c @ 343:6bdf858bff8c
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 28 May 2004 15:49:23 +0000 |
parents | af451db3fe99 |
children | 55e496a8ece3 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_static_handler.c +++ b/src/http/modules/ngx_http_static_handler.c @@ -67,7 +67,7 @@ static ngx_int_t ngx_http_static_handler ngx_str_t name, location; ngx_err_t err; ngx_log_t *log; - ngx_hunk_t *h; + ngx_buf_t *b; ngx_chain_t out; ngx_file_info_t fi; ngx_http_cleanup_t *file_cleanup, *redirect_cleanup; @@ -472,11 +472,11 @@ static ngx_int_t ngx_http_static_handler /* we need to allocate all before the header would be sent */ - if (!(h = ngx_pcalloc(r->pool, sizeof(ngx_hunk_t)))) { + if (!(b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t)))) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } - if (!(h->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t)))) { + if (!(b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t)))) { return NGX_HTTP_INTERNAL_SERVER_ERROR; } @@ -487,15 +487,19 @@ static ngx_int_t ngx_http_static_handler return rc; } - h->type = r->main ? NGX_HUNK_FILE : NGX_HUNK_FILE|NGX_HUNK_LAST; + b->in_file = 1; - h->file_pos = 0; - h->file_last = ngx_file_size(&fi); + if (!r->main) { + b->last_buf = 1; + } - h->file->fd = fd; - h->file->log = log; + b->file_pos = 0; + b->file_last = ngx_file_size(&fi); - out.hunk = h; + b->file->fd = fd; + b->file->log = log; + + out.buf = b; out.next = NULL; return ngx_http_output_filter(r, &out);