mirror of
https://github.com/nginx/nginx.git
synced 2024-12-12 02:09:04 +08: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
@ -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…
Reference in New Issue
Block a user