# HG changeset patch # User Roman Arutyunyan # Date 1643093150 -10800 # Node ID 000b9b048e0c74c8c575b08f2fa9e4cb22d3dba0 # Parent c389200e10a25af273cac05c1d643a280787a18b QUIC: fixed chain returned from ngx_quic_write_chain(). Previously, when input ended on a QUIC buffer boundary, input chain was not advanced to the next buffer. As a result, ngx_quic_write_chain() returned a chain with an empty buffer instead of NULL. This broke HTTP write filter, preventing it from closing the HTTP request and eventually timing out. Now input chain is always advanced to a buffer that has data, before checking QUIC buffer boundary condition. diff -r c389200e10a2 -r 000b9b048e0c src/event/quic/ngx_event_quic_frames.c --- a/src/event/quic/ngx_event_quic_frames.c Fri Jan 21 11:41:39 2022 +0300 +++ b/src/event/quic/ngx_event_quic_frames.c Tue Jan 25 09:45:50 2022 +0300 @@ -536,14 +536,16 @@ continue; } - for (p = b->pos + offset; p != b->last && in; /* void */ ) { + p = b->pos + offset; + + while (in) { if (!ngx_buf_in_memory(in->buf) || in->buf->pos == in->buf->last) { in = in->next; continue; } - if (limit == 0) { + if (p == b->last || limit == 0) { break; }