comparison src/http/ngx_http_request_body.c @ 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
comparison
equal deleted inserted replaced
9238:392e8e2fd22a 9239:b2e16e8639c8
411 411
412 if (rb->rest == 0) { 412 if (rb->rest == 0) {
413 break; 413 break;
414 } 414 }
415 415
416 if (rb->buf->last < rb->buf->end) { 416 if (!c->read->ready) {
417 break; 417 break;
418 } 418 }
419 } 419 }
420 420
421 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 421 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,