comparison src/event/quic/ngx_event_quic_frames.c @ 8975:000b9b048e0c quic

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.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 25 Jan 2022 09:45:50 +0300
parents 065c73221b7b
children 740e8b99519d
comparison
equal deleted inserted replaced
8974:c389200e10a2 8975:000b9b048e0c
534 } 534 }
535 535
536 continue; 536 continue;
537 } 537 }
538 538
539 for (p = b->pos + offset; p != b->last && in; /* void */ ) { 539 p = b->pos + offset;
540
541 while (in) {
540 542
541 if (!ngx_buf_in_memory(in->buf) || in->buf->pos == in->buf->last) { 543 if (!ngx_buf_in_memory(in->buf) || in->buf->pos == in->buf->last) {
542 in = in->next; 544 in = in->next;
543 continue; 545 continue;
544 } 546 }
545 547
546 if (limit == 0) { 548 if (p == b->last || limit == 0) {
547 break; 549 break;
548 } 550 }
549 551
550 n = ngx_min(b->last - p, in->buf->last - in->buf->pos); 552 n = ngx_min(b->last - p, in->buf->last - in->buf->pos);
551 n = ngx_min(n, limit); 553 n = ngx_min(n, limit);