Mercurial > hg > nginx
comparison src/os/unix/ngx_readv_chain.c @ 7886:7f5e3595caff
Use only preallocated memory in ngx_readv_chain() (ticket #1408).
In d1bde5c3c5d2, the number of preallocated iovec's for ngx_readv_chain()
was increased. Still, in some setups, the function might allocate memory
for iovec's from a connection pool, which is only freed when closing the
connection.
The ngx_readv_chain() function was modified to use only preallocated
memory, similarly to the ngx_writev_chain() change in 8e903522c17a.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 05 Jul 2021 13:09:23 +0300 |
parents | efd71d49bde0 |
children | 5119c8150478 |
comparison
equal
deleted
inserted
replaced
7885:e0fdd75871e4 | 7886:7f5e3595caff |
---|---|
94 | 94 |
95 if (prev == chain->buf->last) { | 95 if (prev == chain->buf->last) { |
96 iov->iov_len += n; | 96 iov->iov_len += n; |
97 | 97 |
98 } else { | 98 } else { |
99 if (vec.nelts >= IOV_MAX) { | 99 if (vec.nelts == vec.nalloc) { |
100 break; | 100 break; |
101 } | 101 } |
102 | 102 |
103 iov = ngx_array_push(&vec); | 103 iov = ngx_array_push(&vec); |
104 if (iov == NULL) { | 104 if (iov == NULL) { |