diff options
author | Vladimir Homutov <vl@nginx.com> | 2022-02-02 14:16:48 +0300 |
---|---|---|
committer | Vladimir Homutov <vl@nginx.com> | 2022-02-02 14:16:48 +0300 |
commit | 3b4d10caf6eb3cb7b86c1b6064869b935a7d0076 (patch) | |
tree | abe0d7429255906378de5d31308f3c9c78dfffc5 /src | |
parent | 5a79f55dab7f515eca56639d3bff05b1376701d5 (diff) | |
download | nginx-3b4d10caf6eb3cb7b86c1b6064869b935a7d0076.tar.gz nginx-3b4d10caf6eb3cb7b86c1b6064869b935a7d0076.zip |
QUIC: fixed padding of initial packets in case of limited path.
Previously, non-padded initial packet could be sent as a result of the
following situation:
- initial queue is not empty (so padding to 1200 is required)
- handshake queue is not empty (so padding is to be added after h/s packet)
- path is limited
If serializing handshake packet would violate path limit, such packet was
omitted, and the non-padded initial packet was sent.
The fix is to avoid sending the packet at all in such case. This follows the
original intention introduced in c5155a0cb12f.
Diffstat (limited to 'src')
-rw-r--r-- | src/event/quic/ngx_event_quic_output.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/event/quic/ngx_event_quic_output.c b/src/event/quic/ngx_event_quic_output.c index b34ca7855..103dd0e5c 100644 --- a/src/event/quic/ngx_event_quic_output.c +++ b/src/event/quic/ngx_event_quic_output.c @@ -158,7 +158,14 @@ ngx_quic_create_datagrams(ngx_connection_t *c) ? NGX_QUIC_MIN_INITIAL_SIZE - (p - dst) : 0; if (min > len) { - continue; + /* padding can't be applied - avoid sending the packet */ + + for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { + ctx = &qc->send_ctx[i]; + ngx_quic_revert_send(c, ctx, preserved_pnum[i]); + } + + return NGX_OK; } n = ngx_quic_output_packet(c, ctx, p, len, min); |