comparison src/http/ngx_http_write_filter.c @ 403:ea3113b181d1

nginx-0.0.9-2004-07-28-23:21:26 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 28 Jul 2004 19:21:26 +0000
parents f209f3391020
children da8c5707af39
comparison
equal deleted inserted replaced
402:f209f3391020 403:ea3113b181d1
38 38
39 39
40 ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in) 40 ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
41 { 41 {
42 int last; 42 int last;
43 off_t size, flush, sent, bsize; 43 off_t size, flush, sent;
44 ngx_chain_t *cl, *ln, **ll, *chain; 44 ngx_chain_t *cl, *ln, **ll, *chain;
45 ngx_connection_t *c; 45 ngx_connection_t *c;
46 ngx_http_core_loc_conf_t *clcf; 46 ngx_http_core_loc_conf_t *clcf;
47 ngx_http_write_filter_ctx_t *ctx; 47 ngx_http_write_filter_ctx_t *ctx;
48 48
80 for (ln = in; ln; ln = ln->next) { 80 for (ln = in; ln; ln = ln->next) {
81 ngx_alloc_link_and_set_buf(cl, ln->buf, r->pool, NGX_ERROR); 81 ngx_alloc_link_and_set_buf(cl, ln->buf, r->pool, NGX_ERROR);
82 *ll = cl; 82 *ll = cl;
83 ll = &cl->next; 83 ll = &cl->next;
84 84
85 bsize = ngx_buf_size(cl->buf); 85 size += ngx_buf_size(cl->buf);
86
87 if (bsize == 0 && cl->buf->in_file) {
88 cl->buf->in_file = 0;
89 }
90
91 size += bsize;
92 86
93 if (cl->buf->flush || cl->buf->recycled) { 87 if (cl->buf->flush || cl->buf->recycled) {
94 flush = size; 88 flush = size;
95 } 89 }
96 90