diff src/os/unix/ngx_readv_chain.c @ 5854:b63e829621ab

Generalized definitions of the number of preallocated iovec's. No functional changes.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 13 Aug 2014 15:11:45 +0400
parents 43512a33e8f2
children a0a14319968b
line wrap: on
line diff
--- 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
     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
     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 */