aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_readv_chain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_readv_chain.c')
-rw-r--r--src/os/unix/ngx_readv_chain.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 373c4027c..7b6badfa8 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -71,6 +71,10 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
iov->iov_len += chain->buf->end - chain->buf->last;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_ERROR;
@@ -195,6 +199,10 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
iov->iov_len += chain->buf->end - chain->buf->last;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_ERROR;