mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Write filter: replaced unneeded loop with one to free chains.
Noted by Gabor Lekeny.
This commit is contained in:
parent
605a0ab2e1
commit
5867c81fe6
@ -185,18 +185,14 @@ ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
|
||||
}
|
||||
|
||||
if (size == 0 && !(c->buffered & NGX_LOWLEVEL_BUFFERED)) {
|
||||
if (last) {
|
||||
r->out = NULL;
|
||||
c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
|
||||
|
||||
return NGX_OK;
|
||||
if (last || flush) {
|
||||
for (cl = r->out; cl; /* void */) {
|
||||
ln = cl;
|
||||
cl = cl->next;
|
||||
ngx_free_chain(r->pool, ln);
|
||||
}
|
||||
|
||||
if (flush) {
|
||||
do {
|
||||
r->out = r->out->next;
|
||||
} while (r->out);
|
||||
|
||||
r->out = NULL;
|
||||
c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
|
||||
|
||||
return NGX_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user