Mercurial > hg > nginx
changeset 8573:6226f834b420 quic
QUIC: do not resend empty queue when speeding up handshake.
If client acknowledged an Initial packet with CRYPTO frame and then
sent another Initial packet containing duplicate CRYPTO again, this
could result in resending frames off the empty send queue.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 05 Oct 2020 13:02:53 +0100 |
parents | 3bde57a0e6ce |
children | 1d4417e4f2d0 |
files | src/event/ngx_event_quic.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c Mon Oct 05 13:02:38 2020 +0100 +++ b/src/event/ngx_event_quic.c Mon Oct 05 13:02:53 2020 +0100 @@ -2846,6 +2846,7 @@ { uint64_t last; ngx_int_t rc; + ngx_quic_send_ctx_t *ctx; ngx_quic_connection_t *qc; ngx_quic_crypto_frame_t *f; ngx_quic_frames_stream_t *fs; @@ -2871,7 +2872,11 @@ /* speeding up handshake completion */ if (pkt->level == ssl_encryption_initial) { - ngx_quic_resend_frames(c, ngx_quic_get_send_ctx(qc, pkt->level)); + ctx = ngx_quic_get_send_ctx(qc, pkt->level); + + if (!ngx_queue_empty(&ctx->sent)) { + ngx_quic_resend_frames(c, ctx); + } } return NGX_OK;