comparison src/event/quic/ngx_event_quic_output.c @ 9006:5f78174d1ac1 quic

QUIC: fixed output context restoring. The cd8018bc81a5 fixed unintended send of non-padded initial packets, but failed to restore context properly: only processed contexts need to be restored. As a consequence, a packet number could be restored from uninitialized value.
author Vladimir Homutov <vl@nginx.com>
date Wed, 09 Feb 2022 15:53:21 +0300
parents 868e1b76c956
children e5f16d886c97
comparison
equal deleted inserted replaced
9005:e56a05d6dbd1 9006:5f78174d1ac1
163 ? NGX_QUIC_MIN_INITIAL_SIZE - (p - dst) : 0; 163 ? NGX_QUIC_MIN_INITIAL_SIZE - (p - dst) : 0;
164 164
165 if (min > len) { 165 if (min > len) {
166 /* padding can't be applied - avoid sending the packet */ 166 /* padding can't be applied - avoid sending the packet */
167 167
168 for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) { 168 while (i-- > 0) {
169 ctx = &qc->send_ctx[i]; 169 ctx = &qc->send_ctx[i];
170 ngx_quic_revert_send(c, ctx, preserved_pnum[i]); 170 ngx_quic_revert_send(c, ctx, preserved_pnum[i]);
171 } 171 }
172 172
173 return NGX_OK; 173 return NGX_OK;