Mercurial > hg > nginx-quic
comparison src/http/ngx_http_output_filter.c @ 59:e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 06 Feb 2003 17:21:13 +0000 |
parents | a499e0d1f16e |
children | 50186b49f2ad |
comparison
equal
deleted
inserted
replaced
58:6b13b1cadabe | 59:e8cdc2989cee |
---|---|
58 | 58 |
59 | 59 |
60 int ngx_http_output_filter(ngx_http_request_t *r, ngx_hunk_t *hunk) | 60 int ngx_http_output_filter(ngx_http_request_t *r, ngx_hunk_t *hunk) |
61 { | 61 { |
62 int rc, once; | 62 int rc, once; |
63 u_int flags; | |
63 size_t size; | 64 size_t size; |
64 ngx_chain_t *ce; | 65 ngx_chain_t *ce; |
65 ngx_http_output_filter_ctx_t *ctx; | 66 ngx_http_output_filter_ctx_t *ctx; |
66 ngx_http_output_filter_conf_t *conf; | 67 ngx_http_output_filter_conf_t *conf; |
67 | 68 |
270 } | 271 } |
271 | 272 |
272 | 273 |
273 static int ngx_http_output_filter_copy_hunk(ngx_hunk_t *dst, ngx_hunk_t *src) | 274 static int ngx_http_output_filter_copy_hunk(ngx_hunk_t *dst, ngx_hunk_t *src) |
274 { | 275 { |
275 size_t size; | 276 ssize_t n, size; |
276 ssize_t n; | |
277 | 277 |
278 size = src->last.mem - src->pos.mem; | 278 size = src->last.mem - src->pos.mem; |
279 if (size > dst->end - dst->pos.mem) { | 279 if (size > (dst->end - dst->pos.mem)) { |
280 size = dst->end - dst->pos.mem; | 280 size = dst->end - dst->pos.mem; |
281 } | 281 } |
282 | 282 |
283 if (src->type & NGX_HUNK_FILE) { | 283 if (src->type & NGX_HUNK_FILE) { |
284 n = ngx_read_file(src->file, dst->pos.mem, size, src->pos.file); | 284 n = ngx_read_file(src->file, dst->pos.mem, size, src->pos.file); |
335 ngx_http_output_filter_conf_t *prev = | 335 ngx_http_output_filter_conf_t *prev = |
336 (ngx_http_output_filter_conf_t *) parent; | 336 (ngx_http_output_filter_conf_t *) parent; |
337 ngx_http_output_filter_conf_t *conf = | 337 ngx_http_output_filter_conf_t *conf = |
338 (ngx_http_output_filter_conf_t *) child; | 338 (ngx_http_output_filter_conf_t *) child; |
339 | 339 |
340 ngx_conf_merge(conf->hunk_size, prev->hunk_size, 32768); | 340 ngx_conf_size_merge(conf->hunk_size, prev->hunk_size, 32768); |
341 | 341 |
342 return NULL; | 342 return NULL; |
343 } | 343 } |