comparison src/event/ngx_event_quic.c @ 7760:32db41d603cd quic

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.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 27 Mar 2020 10:02:45 +0300
parents 1ec905f4d851
children 4ad7d4272cd5
comparison
equal deleted inserted replaced
7759:1ec905f4d851 7760:32db41d603cd
1155 } 1155 }
1156 1156
1157 b = sn->b; 1157 b = sn->b;
1158 b->last = ngx_cpymem(b->last, f->data, f->length); 1158 b->last = ngx_cpymem(b->last, f->data, f->length);
1159 1159
1160 sn->c->read->ready = 1; 1160 rev = sn->c->read;
1161 rev->ready = 1;
1162
1163 if (f->fin) {
1164 rev->pending_eof = 1;
1165 }
1161 1166
1162 qc->streams.handler(sn->c); 1167 qc->streams.handler(sn->c);
1163 1168
1164 return NGX_OK; 1169 return NGX_OK;
1165 } 1170 }
1593 b->pos += len; 1598 b->pos += len;
1594 1599
1595 if (b->pos == b->last) { 1600 if (b->pos == b->last) {
1596 b->pos = b->start; 1601 b->pos = b->start;
1597 b->last = b->start; 1602 b->last = b->start;
1598 rev->ready = 0; 1603 rev->ready = rev->pending_eof;
1599 } 1604 }
1600 1605
1601 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0, 1606 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
1602 "quic recv: %z of %uz", len, size); 1607 "quic recv: %z of %uz", len, size);
1603 1608