changeset 9239:b2e16e8639c8

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 30 Mar 2024 05:09:12 +0300
parents 392e8e2fd22a
children f3df785649ae
files src/http/ngx_http_request_body.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;
             }
         }