Mercurial > hg > nginx
diff src/event/ngx_event_pipe.c @ 168:ba5dbb949603
nginx-0.0.1-2003-10-31-10:10:36 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 31 Oct 2003 07:10:36 +0000 |
parents | 389d7ee9fa60 |
children | c42be4185301 |
line wrap: on
line diff
--- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -252,7 +252,7 @@ int ngx_event_pipe_read_upstream(ngx_eve if (n >= size) { cl->hunk->last = cl->hunk->end; - /* STUB */ cl->hunk->num = p->num++; +/* STUB */ cl->hunk->num = p->num++; if (p->input_filter(p, cl->hunk) == NGX_ERROR) { return NGX_ABORT; @@ -271,15 +271,17 @@ int ngx_event_pipe_read_upstream(ngx_eve } if ((p->upstream_eof || p->upstream_error) && p->free_raw_hunks) { - /* STUB */ p->free_raw_hunks->hunk->num = p->num++; +/* STUB */ p->free_raw_hunks->hunk->num = p->num++; if (p->input_filter(p, p->free_raw_hunks->hunk) == NGX_ERROR) { return NGX_ABORT; } p->free_raw_hunks = p->free_raw_hunks->next; - for (cl = p->free_raw_hunks; cl; cl = cl->next) { - ngx_pfree(p->pool, cl->hunk->start); + if (p->free_bufs) { + for (cl = p->free_raw_hunks; cl; cl = cl->next) { + ngx_pfree(p->pool, cl->hunk->start); + } } } @@ -394,6 +396,7 @@ int ngx_event_pipe_write_to_downstream(n for (cl = p->free; cl; cl = cl->next) { + /* TODO: free hunk if p->free_bufs && upstream done */ /* add the free shadow raw hunk to p->free_raw_hunks */ if (cl->hunk->type & NGX_HUNK_LAST_SHADOW) {