No functional changes.
*/
-#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_darwin_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;
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 ( ;; ) {
*/
-#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)
{
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;
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 ( ;; ) {
#define NGX_SENDFILE_MAXSIZE 2147483647L
-#if (IOV_MAX > 64)
-#define NGX_HEADERS 64
-#else
-#define NGX_HEADERS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
ngx_array_t header;
ngx_event_t *wev;
ngx_chain_t *cl;
- struct iovec *iov, headers[NGX_HEADERS];
+ struct iovec *iov, headers[NGX_IOVS_PREALLOCATE];
#if (NGX_HAVE_SENDFILE64)
off_t offset;
#else
header.elts = headers;
header.size = sizeof(struct iovec);
- header.nalloc = NGX_HEADERS;
+ header.nalloc = NGX_IOVS_PREALLOCATE;
header.pool = c->pool;
for ( ;; ) {
#endif
+#if (IOV_MAX > 64)
+#define NGX_IOVS_PREALLOCATE 64
+#else
+#define NGX_IOVS_PREALLOCATE IOV_MAX
+#endif
+
+
extern ngx_os_io_t ngx_os_io;
extern ngx_int_t ngx_ncpu;
extern ngx_int_t ngx_max_sockets;
#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)
{
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;
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 */
#endif
-#if (IOV_MAX > 64)
-#define NGX_SENDFILEVECS 64
-#else
-#define NGX_SENDFILEVECS IOV_MAX
-#endif
-
+#define NGX_SENDFILEVECS NGX_IOVS_PREALLOCATE
ngx_chain_t *
#include <ngx_event.h>
-#if (IOV_MAX > 64)
-#define NGX_IOVS 64
-#else
-#define NGX_IOVS IOV_MAX
-#endif
-
-
ngx_chain_t *
ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
{
ngx_array_t vec;
ngx_chain_t *cl;
ngx_event_t *wev;
- struct iovec *iov, iovs[NGX_IOVS];
+ struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
wev = c->write;
vec.elts = iovs;
vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
+ vec.nalloc = NGX_IOVS_PREALLOCATE;
vec.pool = c->pool;
for ( ;; ) {