From ea72fa1d92af638e23def2da1790b9b0566bd23b Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Wed, 15 Apr 2026 22:22:43 +0400 Subject: QUIC: simplified ngx_quic_cbs_recv_rcd() There's no need in for-loop, a single buffer is fed at a time. --- src/event/quic/ngx_event_quic_ssl.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'src/event') diff --git a/src/event/quic/ngx_event_quic_ssl.c b/src/event/quic/ngx_event_quic_ssl.c index 4e84f8102..705f39f6c 100644 --- a/src/event/quic/ngx_event_quic_ssl.c +++ b/src/event/quic/ngx_event_quic_ssl.c @@ -152,27 +152,19 @@ ngx_quic_cbs_recv_rcd(ngx_ssl_conn_t *ssl_conn, qc = ngx_quic_get_connection(c); ctx = ngx_quic_get_send_ctx(qc, qc->read_level); - for (cl = ctx->crypto.chain; cl; cl = cl->next) { - b = cl->buf; - - if (b->sync) { - /* hole */ + cl = ctx->crypto.chain; - *data = NULL; - *bytes_read = 0; + if (cl == NULL || cl->buf->sync) { + *data = NULL; + *bytes_read = 0; - break; - } + } else { + b = cl->buf; *data = b->pos; *bytes_read = b->last - b->pos; - - break; } - *data = NULL; - *bytes_read = 0; - return 1; } -- cgit