diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-10-31 07:10:36 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-10-31 07:10:36 +0000 |
commit | 219d44dd5d6a2726f39dbb1fdb9ca2a66fd2ee24 (patch) | |
tree | 84da926421cdaabbe60205b3bf24d53825922510 /src/event/ngx_event_pipe.c | |
parent | b5910d497e51bac754b0a5bdbd58318b653e0859 (diff) | |
download | nginx-219d44dd5d6a2726f39dbb1fdb9ca2a66fd2ee24.tar.gz nginx-219d44dd5d6a2726f39dbb1fdb9ca2a66fd2ee24.zip |
nginx-0.0.1-2003-10-31-10:10:36 import
Diffstat (limited to 'src/event/ngx_event_pipe.c')
-rw-r--r-- | src/event/ngx_event_pipe.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c index 387d8b861..0d6e89159 100644 --- 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_event_pipe_t *p) 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_event_pipe_t *p) } 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(ngx_event_pipe_t *p) 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) { |