comparison src/event/ngx_event_quic.c @ 8553:dbcb9d0a3df1 quic

QUIC: prevented posted push event while in the draining state. If the push event was posted before ngx_quic_close_connection(), it could send data in the draining state.
author Vladimir Homutov <vl@nginx.com>
date Mon, 21 Sep 2020 13:58:17 +0300
parents eece8e35e64d
children b383120afca3
comparison
equal deleted inserted replaced
8552:351d62300832 8553:dbcb9d0a3df1
1490 1490
1491 if (ngx_quic_close_streams(c, qc) == NGX_AGAIN) { 1491 if (ngx_quic_close_streams(c, qc) == NGX_AGAIN) {
1492 return NGX_AGAIN; 1492 return NGX_AGAIN;
1493 } 1493 }
1494 1494
1495 if (qc->close.timer_set) { 1495 if (qc->push.timer_set) {
1496 return NGX_AGAIN; 1496 ngx_del_timer(&qc->push);
1497 }
1498
1499 if (qc->pto.timer_set) {
1500 ngx_del_timer(&qc->pto);
1501 }
1502
1503 if (qc->push.posted) {
1504 ngx_delete_posted_event(&qc->push);
1497 } 1505 }
1498 1506
1499 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) { 1507 for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) {
1500 ngx_quic_free_frames(c, &qc->crypto[i].frames); 1508 ngx_quic_free_frames(c, &qc->crypto[i].frames);
1501 } 1509 }
1503 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { 1511 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) {
1504 ngx_quic_free_frames(c, &qc->send_ctx[i].frames); 1512 ngx_quic_free_frames(c, &qc->send_ctx[i].frames);
1505 ngx_quic_free_frames(c, &qc->send_ctx[i].sent); 1513 ngx_quic_free_frames(c, &qc->send_ctx[i].sent);
1506 } 1514 }
1507 1515
1508 if (qc->push.timer_set) { 1516 if (qc->close.timer_set) {
1509 ngx_del_timer(&qc->push); 1517 return NGX_AGAIN;
1510 }
1511
1512 if (qc->pto.timer_set) {
1513 ngx_del_timer(&qc->pto);
1514 }
1515
1516 if (qc->push.posted) {
1517 ngx_delete_posted_event(&qc->push);
1518 } 1518 }
1519 1519
1520 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, 1520 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
1521 "quic part of connection is terminated"); 1521 "quic part of connection is terminated");
1522 1522