comparison 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
comparison
equal deleted inserted replaced
5465:a279d2a33dbf 5466:e7b3b9855be8
1825 1825
1826 if (f->pos == f->last) { 1826 if (f->pos == f->last) {
1827 break; 1827 break;
1828 } 1828 }
1829 1829
1830 if (p->free) { 1830 cl = ngx_chain_get_free_buf(p->pool, &p->free);
1831 cl = p->free; 1831 if (cl == NULL) {
1832 b = cl->buf; 1832 return NGX_ERROR;
1833 p->free = cl->next; 1833 }
1834 ngx_free_chain(p->pool, cl); 1834
1835 1835 b = cl->buf;
1836 } else {
1837 b = ngx_alloc_buf(p->pool);
1838 if (b == NULL) {
1839 return NGX_ERROR;
1840 }
1841 }
1842 1836
1843 ngx_memzero(b, sizeof(ngx_buf_t)); 1837 ngx_memzero(b, sizeof(ngx_buf_t));
1844 1838
1845 b->pos = f->pos; 1839 b->pos = f->pos;
1846 b->start = buf->start; 1840 b->start = buf->start;
1849 b->temporary = 1; 1843 b->temporary = 1;
1850 b->recycled = 1; 1844 b->recycled = 1;
1851 1845
1852 *prev = b; 1846 *prev = b;
1853 prev = &b->shadow; 1847 prev = &b->shadow;
1854
1855 cl = ngx_alloc_chain_link(p->pool);
1856 if (cl == NULL) {
1857 return NGX_ERROR;
1858 }
1859
1860 cl->buf = b;
1861 cl->next = NULL;
1862 1848
1863 if (p->in) { 1849 if (p->in) {
1864 *p->last_in = cl; 1850 *p->last_in = cl;
1865 } else { 1851 } else {
1866 p->in = cl; 1852 p->in = cl;