mirror of
https://github.com/nginx/nginx.git
synced 2026-08-03 22:33:10 +00:00
Fixed ngx_readv_chain() to honor IOV_MAX (ticket #14).
Not using full chain passed is ok as consumers are expected to check event's ready flag to determine if another call is needed, not the returned size.
This commit is contained in:
parent
578c02f3a1
commit
0abb0bce5f
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue