Mercurial > hg > nginx-quic
comparison src/event/ngx_event_quic.c @ 8132: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 |
comparison
equal
deleted
inserted
replaced
8131:3bde57a0e6ce | 8132:6226f834b420 |
---|---|
2844 ngx_quic_handle_crypto_frame(ngx_connection_t *c, ngx_quic_header_t *pkt, | 2844 ngx_quic_handle_crypto_frame(ngx_connection_t *c, ngx_quic_header_t *pkt, |
2845 ngx_quic_frame_t *frame) | 2845 ngx_quic_frame_t *frame) |
2846 { | 2846 { |
2847 uint64_t last; | 2847 uint64_t last; |
2848 ngx_int_t rc; | 2848 ngx_int_t rc; |
2849 ngx_quic_send_ctx_t *ctx; | |
2849 ngx_quic_connection_t *qc; | 2850 ngx_quic_connection_t *qc; |
2850 ngx_quic_crypto_frame_t *f; | 2851 ngx_quic_crypto_frame_t *f; |
2851 ngx_quic_frames_stream_t *fs; | 2852 ngx_quic_frames_stream_t *fs; |
2852 | 2853 |
2853 qc = c->quic; | 2854 qc = c->quic; |
2869 } | 2870 } |
2870 | 2871 |
2871 /* speeding up handshake completion */ | 2872 /* speeding up handshake completion */ |
2872 | 2873 |
2873 if (pkt->level == ssl_encryption_initial) { | 2874 if (pkt->level == ssl_encryption_initial) { |
2874 ngx_quic_resend_frames(c, ngx_quic_get_send_ctx(qc, pkt->level)); | 2875 ctx = ngx_quic_get_send_ctx(qc, pkt->level); |
2876 | |
2877 if (!ngx_queue_empty(&ctx->sent)) { | |
2878 ngx_quic_resend_frames(c, ctx); | |
2879 } | |
2875 } | 2880 } |
2876 | 2881 |
2877 return NGX_OK; | 2882 return NGX_OK; |
2878 } | 2883 } |
2879 | 2884 |