diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-05-28 15:49:23 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-05-28 15:49:23 +0000 |
commit | 369145cef1971e4273dc59340689c2d96f84d18a (patch) | |
tree | 55f59267d9ada5160ad74168bf5721ce5b3653ff /src/http/modules/ngx_http_static_handler.c | |
parent | 87a7d1c44917e352e336c859c2a797e5d60b19da (diff) | |
download | nginx-369145cef1971e4273dc59340689c2d96f84d18a.tar.gz nginx-369145cef1971e4273dc59340689c2d96f84d18a.zip |
nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_t
Diffstat (limited to 'src/http/modules/ngx_http_static_handler.c')
-rw-r--r-- | src/http/modules/ngx_http_static_handler.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/http/modules/ngx_http_static_handler.c b/src/http/modules/ngx_http_static_handler.c index d06113b8a..532e8faab 100644 --- 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_http_request_t *r) 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(ngx_http_request_t *r) /* 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(ngx_http_request_t *r) 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; + } + + b->file_pos = 0; + b->file_last = ngx_file_size(&fi); - h->file->fd = fd; - h->file->log = log; + b->file->fd = fd; + b->file->log = log; - out.hunk = h; + out.buf = b; out.next = NULL; return ngx_http_output_filter(r, &out); |