comparison src/http/v3/ngx_http_v3_request.c @ 9241:07ca679842de

HTTP/3: synced request body reading changes to reduce diffs.
author Maxim Dounin <mdounin@mdounin.ru>
date Sat, 30 Mar 2024 05:10:24 +0300
parents 4939fd04737f
children 3728a0ed243a
comparison
equal deleted inserted replaced
9240:f3df785649ae 9241:07ca679842de
1327 ngx_http_core_loc_conf_t *clcf; 1327 ngx_http_core_loc_conf_t *clcf;
1328 1328
1329 c = r->connection; 1329 c = r->connection;
1330 rb = r->request_body; 1330 rb = r->request_body;
1331 flush = 1; 1331 flush = 1;
1332 n = NGX_AGAIN;
1332 1333
1333 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, 1334 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
1334 "http3 read client request body"); 1335 "http3 read client request body");
1335 1336
1336 for ( ;; ) { 1337 for ( ;; ) {
1430 1431
1431 if (rb->rest == 0) { 1432 if (rb->rest == 0) {
1432 break; 1433 break;
1433 } 1434 }
1434 1435
1435 if (rb->buf->last < rb->buf->end) { 1436 if (!c->read->ready) {
1436 break; 1437 break;
1437 } 1438 }
1438 } 1439 }
1439 1440
1440 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 1441 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
1450 1451
1451 if (rb->rest == 0 && rb->last_saved) { 1452 if (rb->rest == 0 && rb->last_saved) {
1452 break; 1453 break;
1453 } 1454 }
1454 1455
1455 if (!c->read->ready || rb->rest == 0) { 1456 if (n == NGX_AGAIN || !c->read->ready || rb->rest == 0) {
1456 1457
1457 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 1458 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1458 ngx_add_timer(c->read, clcf->client_body_timeout); 1459 ngx_add_timer(c->read, clcf->client_body_timeout);
1459 1460
1460 if (ngx_handle_read_event(c->read, 0) != NGX_OK) { 1461 if (ngx_handle_read_event(c->read, 0) != NGX_OK) {