comparison src/event/ngx_event_quic.c @ 8336:739f018225af quic

Free remaining frames on connection close. Frames can still float in the following queues: - crypto frames reordering queues (one per encryption level) - moved crypto frames cleanup to the moment where all streams are closed - stream frames reordering queues (one per packet number namespace) - frames retransmit queues (one per packet number namespace)
author Vladimir Homutov <vl@nginx.com>
date Wed, 15 Apr 2020 13:09:39 +0300
parents 76839f55bc48
children ab443e80d9e4
comparison
equal deleted inserted replaced
8335:76839f55bc48 8336:739f018225af
748 748
749 qc = c->quic; 749 qc = c->quic;
750 750
751 if (qc) { 751 if (qc) {
752 752
753 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) {
754 ngx_quic_free_frames(c, &qc->crypto[i].frames);
755 }
756
757 qc->closing = 1; 753 qc->closing = 1;
758 tree = &qc->streams.tree; 754 tree = &qc->streams.tree;
759 755
760 if (tree->root != tree->sentinel) { 756 if (tree->root != tree->sentinel) {
761 if (c->read->timer_set) { 757 if (c->read->timer_set) {
789 785
790 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, 786 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
791 "quic connection has %ui active streams", ns); 787 "quic connection has %ui active streams", ns);
792 788
793 return; 789 return;
790 }
791
792 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) {
793 ngx_quic_free_frames(c, &qc->crypto[i].frames);
794 }
795
796 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) {
797 ngx_quic_free_frames(c, &qc->send_ctx[i].frames);
798 ngx_quic_free_frames(c, &qc->send_ctx[i].sent);
794 } 799 }
795 800
796 if (qc->push.timer_set) { 801 if (qc->push.timer_set) {
797 ngx_del_timer(&qc->push); 802 ngx_del_timer(&qc->push);
798 } 803 }