[nginx] Request body: improved c->read->ready flag handling.
Maxim Dounin
mdounin at mdounin.ru
Sat Mar 30 04:59:46 UTC 2024
details: http://freenginx.org/hg/nginx/rev/b2e16e8639c8
branches:
changeset: 9239:b2e16e8639c8
user: Maxim Dounin <mdounin at mdounin.ru>
date: Sat Mar 30 05:09:12 2024 +0300
description:
Request body: improved c->read->ready flag handling.
Previously, the c->read->ready flag was only checked when c->recv() wasn't
able to fill the whole body buffer. Now the flag is also checked if
the buffer is fully filled.
This ensures that ev->available checks as introduced in 7583:efd71d49bde0
and 7584:9d2ad2fb4423 will be able to prevent reading from the socket
when using event methods other than kqueue or epoll, and when using SSL.
This might be important to avoid looping for a long time when reading
request body from fast clients.
diffstat:
src/http/ngx_http_request_body.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diffs (12 lines):
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -413,7 +413,7 @@ ngx_http_do_read_client_request_body(ngx
break;
}
- if (rb->buf->last < rb->buf->end) {
+ if (!c->read->ready) {
break;
}
}
More information about the nginx-devel
mailing list