diff options
author | Valentin Bartenev <vbart@nginx.com> | 2014-08-13 15:11:45 +0400 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2014-08-13 15:11:45 +0400 |
commit | 651be6067ec12cee11fb70bd9be23c4858604a92 (patch) | |
tree | 648b58390643f0b5a11ff92710aa4533d5d82a95 /src/os/unix/ngx_freebsd_sendfile_chain.c | |
parent | 1cbeabfd4cda90e600756380b137b9065f645e83 (diff) |
Generalized definitions of the number of preallocated iovec's.
No functional changes.
Diffstat (limited to 'src/os/unix/ngx_freebsd_sendfile_chain.c')
-rw-r--r-- | src/os/unix/ngx_freebsd_sendfile_chain.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c index 09f66a2c6..f5d0f3a8a 100644 --- a/src/os/unix/ngx_freebsd_sendfile_chain.c +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c @@ -29,15 +29,6 @@ */ -#if (IOV_MAX > 64) -#define NGX_HEADERS 64 -#define NGX_TRAILERS 64 -#else -#define NGX_HEADERS IOV_MAX -#define NGX_TRAILERS IOV_MAX -#endif - - ngx_chain_t * ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) { @@ -52,7 +43,9 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) ngx_event_t *wev; ngx_chain_t *cl; struct sf_hdtr hdtr; - struct iovec *iov, headers[NGX_HEADERS], trailers[NGX_TRAILERS]; + struct iovec *iov; + struct iovec headers[NGX_IOVS_PREALLOCATE]; + struct iovec trailers[NGX_IOVS_PREALLOCATE]; wev = c->write; @@ -83,12 +76,12 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) header.elts = headers; header.size = sizeof(struct iovec); - header.nalloc = NGX_HEADERS; + header.nalloc = NGX_IOVS_PREALLOCATE; header.pool = c->pool; trailer.elts = trailers; trailer.size = sizeof(struct iovec); - trailer.nalloc = NGX_TRAILERS; + trailer.nalloc = NGX_IOVS_PREALLOCATE; trailer.pool = c->pool; for ( ;; ) { |