diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2022-02-15 14:12:34 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2022-02-15 14:12:34 +0300 |
commit | 1381932d27a2ccba206633bb5febea72de9c56c2 (patch) | |
tree | 588db67a3f4dcf721b122cd9b127bd0b453fafe4 /src | |
parent | a767450093200c76dba8851a9453f13296dd6371 (diff) | |
download | nginx-1381932d27a2ccba206633bb5febea72de9c56c2.tar.gz nginx-1381932d27a2ccba206633bb5febea72de9c56c2.zip |
QUIC: optimized datagram expansion with half-RTT tickets.
As shown in RFC 8446, section 2.2, Figure 3, and further specified in
section 4.6.1, BoringSSL releases session tickets in Application Data
(along with Finished) early, based on a precalculated client Finished
transcript, once client signalled early data in extensions.
Diffstat (limited to 'src')
-rw-r--r-- | src/event/quic/ngx_event_quic_output.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c index 72a678c3d..b72d3319e 100644 --- a/src/event/quic/ngx_event_quic_output.c +++ b/src/event/quic/ngx_event_quic_output.c @@ -476,6 +476,7 @@ ngx_quic_send_segments(ngx_connection_t *c, u_char *buf, size_t len, static ngx_uint_t ngx_quic_get_padding_level(ngx_connection_t *c) { + ngx_uint_t i; ngx_queue_t *q; ngx_quic_frame_t *f; ngx_quic_send_ctx_t *ctx; @@ -499,13 +500,15 @@ ngx_quic_get_padding_level(ngx_connection_t *c) f = ngx_queue_data(q, ngx_quic_frame_t, queue); if (f->need_ack) { - ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_handshake); + for (i = 0; i + 1 < NGX_QUIC_SEND_CTX_LAST; i++) { + ctx = &qc->send_ctx[i + 1]; - if (ngx_queue_empty(&ctx->frames)) { - return 0; + if (ngx_queue_empty(&ctx->frames)) { + break; + } } - return 1; + return i; } } |