Welcome! Log In Create A New Profile

Advanced

[nginx] Use only preallocated memory in ngx_readv_chain() (ticket #1408).

July 05, 2021 12:36PM
details: https://hg.nginx.org/nginx/rev/7f5e3595caff
branches:
changeset: 7886:7f5e3595caff
user: Ruslan Ermilov <ru@nginx.com>
date: Mon Jul 05 13:09:23 2021 +0300
description:
Use only preallocated memory in ngx_readv_chain() (ticket #1408).

In d1bde5c3c5d2, the number of preallocated iovec's for ngx_readv_chain()
was increased. Still, in some setups, the function might allocate memory
for iovec's from a connection pool, which is only freed when closing the
connection.

The ngx_readv_chain() function was modified to use only preallocated
memory, similarly to the ngx_writev_chain() change in 8e903522c17a.

diffstat:

src/os/unix/ngx_readv_chain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r e0fdd75871e4 -r 7f5e3595caff src/os/unix/ngx_readv_chain.c
--- a/src/os/unix/ngx_readv_chain.c Mon Jun 28 18:01:24 2021 +0300
+++ b/src/os/unix/ngx_readv_chain.c Mon Jul 05 13:09:23 2021 +0300
@@ -96,7 +96,7 @@ ngx_readv_chain(ngx_connection_t *c, ngx
iov->iov_len += n;

} else {
- if (vec.nelts >= IOV_MAX) {
+ if (vec.nelts == vec.nalloc) {
break;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Use only preallocated memory in ngx_readv_chain() (ticket #1408).

ru@nginx.com 592 July 05, 2021 12:36PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 273
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready