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.
This commit is contained in:
Vladimir Homutov 2020-09-21 13:58:17 +03:00
parent be719bbec8
commit 766fc16f55

View File

@ -1492,8 +1492,16 @@ ngx_quic_close_quic(ngx_connection_t *c, ngx_int_t rc)
return NGX_AGAIN; return NGX_AGAIN;
} }
if (qc->close.timer_set) { if (qc->push.timer_set) {
return NGX_AGAIN; ngx_del_timer(&qc->push);
}
if (qc->pto.timer_set) {
ngx_del_timer(&qc->pto);
}
if (qc->push.posted) {
ngx_delete_posted_event(&qc->push);
} }
for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) { for (i = 0; i < NGX_QUIC_ENCRYPTION_LAST; i++) {
@ -1505,16 +1513,8 @@ ngx_quic_close_quic(ngx_connection_t *c, ngx_int_t rc)
ngx_quic_free_frames(c, &qc->send_ctx[i].sent); ngx_quic_free_frames(c, &qc->send_ctx[i].sent);
} }
if (qc->push.timer_set) { if (qc->close.timer_set) {
ngx_del_timer(&qc->push); return NGX_AGAIN;
}
if (qc->pto.timer_set) {
ngx_del_timer(&qc->pto);
}
if (qc->push.posted) {
ngx_delete_posted_event(&qc->push);
} }
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,