Fixed handling QUIC stream eof.

Set r->pending_eof flag for a new QUIC stream with the fin bit.  Also, keep
r->ready set when r->pending_eof is set and buffer is empty.
This commit is contained in:
Roman Arutyunyan 2020-03-27 10:02:45 +03:00
parent 6bc0ecd946
commit 732e383dd1

View file

@ -1157,7 +1157,12 @@ ngx_quic_handle_stream_frame(ngx_connection_t *c,
b = sn->b;
b->last = ngx_cpymem(b->last, f->data, f->length);
sn->c->read->ready = 1;
rev = sn->c->read;
rev->ready = 1;
if (f->fin) {
rev->pending_eof = 1;
}
qc->streams.handler(sn->c);
@ -1595,7 +1600,7 @@ ngx_quic_stream_recv(ngx_connection_t *c, u_char *buf, size_t size)
if (b->pos == b->last) {
b->pos = b->start;
b->last = b->start;
rev->ready = 0;
rev->ready = rev->pending_eof;
}
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,