Mercurial > hg > nginx
diff src/http/modules/ngx_http_fastcgi_module.c @ 5466:e7b3b9855be8
Use ngx_chain_get_free_buf() in pipe input filters.
No functional changes.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 11 Dec 2013 21:30:38 +0400 |
parents | e68af4e3396f |
children | d15822784cf9 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -1827,19 +1827,13 @@ ngx_http_fastcgi_input_filter(ngx_event_ break; } - if (p->free) { - cl = p->free; - b = cl->buf; - p->free = cl->next; - ngx_free_chain(p->pool, cl); - - } else { - b = ngx_alloc_buf(p->pool); - if (b == NULL) { - return NGX_ERROR; - } + cl = ngx_chain_get_free_buf(p->pool, &p->free); + if (cl == NULL) { + return NGX_ERROR; } + b = cl->buf; + ngx_memzero(b, sizeof(ngx_buf_t)); b->pos = f->pos; @@ -1852,14 +1846,6 @@ ngx_http_fastcgi_input_filter(ngx_event_ *prev = b; prev = &b->shadow; - cl = ngx_alloc_chain_link(p->pool); - if (cl == NULL) { - return NGX_ERROR; - } - - cl->buf = b; - cl->next = NULL; - if (p->in) { *p->last_in = cl; } else {