aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_readv_chain.c
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2014-08-13 15:11:45 +0400
committerValentin Bartenev <vbart@nginx.com>2014-08-13 15:11:45 +0400
commit651be6067ec12cee11fb70bd9be23c4858604a92 (patch)
tree648b58390643f0b5a11ff92710aa4533d5d82a95 /src/os/unix/ngx_readv_chain.c
parent1cbeabfd4cda90e600756380b137b9065f645e83 (diff)
downloadnginx-651be6067ec12cee11fb70bd9be23c4858604a92.tar.gz
nginx-651be6067ec12cee11fb70bd9be23c4858604a92.zip
Generalized definitions of the number of preallocated iovec's.
No functional changes.
Diffstat (limited to 'src/os/unix/ngx_readv_chain.c')
-rw-r--r--src/os/unix/ngx_readv_chain.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 925034c53..8523be367 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -10,13 +10,6 @@
#include <ngx_event.h>
-#if (IOV_MAX > 64)
-#define NGX_IOVS 64
-#else
-#define NGX_IOVS IOV_MAX
-#endif
-
-
ssize_t
ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
{
@@ -25,7 +18,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
ngx_err_t err;
ngx_array_t vec;
ngx_event_t *rev;
- struct iovec *iov, iovs[NGX_IOVS];
+ struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
rev = c->read;
@@ -67,7 +60,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
vec.elts = iovs;
vec.nelts = 0;
vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
+ vec.nalloc = NGX_IOVS_PREALLOCATE;
vec.pool = c->pool;
/* coalesce the neighbouring bufs */