prev = NULL;
iov = NULL;
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
prev = NULL;
iov = NULL;
- while (cl && header.nelts < IOV_MAX && send < limit) {
+ while (cl && send < limit) {
if (ngx_buf_special(cl->buf)) {
cl = cl->next;
iov->iov_len += (size_t) size;
} else {
+ if (trailer.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&trailer);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
prev = NULL;
iov = NULL;
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX){
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
prev = NULL;
iov = NULL;
- while (cl && header.nelts < IOV_MAX && send < limit) {
+ while (cl && send < limit) {
if (ngx_buf_special(cl->buf)) {
cl = cl->next;
iov->iov_len += (size_t) size;
} else {
+ if (trailer.nelts >= IOV_MAX){
+ break;
+ }
+
iov = ngx_array_push(&trailer);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
/* create the iovec and coalesce the neighbouring bufs */
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
/* create the sendfilevec and coalesce the neighbouring bufs */
- for (cl = in; cl && vec.nelts < IOV_MAX && send < limit; cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
sfv->sfv_len += (size_t) size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
sfv = ngx_array_push(&vec);
if (sfv == NULL) {
return NGX_CHAIN_ERROR;
sfv->sfv_len += (size_t) size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
sfv = ngx_array_push(&vec);
if (sfv == NULL) {
return NGX_CHAIN_ERROR;
/* create the iovec and coalesce the neighbouring bufs */
- for (cl = in; cl && vec.nelts < IOV_MAX && send < limit; cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
iov->iov_len += size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_CHAIN_ERROR;