Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic_connid.c @ 8797:4715f3e669f1 quic
QUIC: updated specification references.
This includes updating citations and further clarification.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 16 Jun 2021 11:55:12 +0300 |
parents | 5186ee5a94b9 |
children | e2ec952dc295 |
comparison
equal
deleted
inserted
replaced
8796:1fec68e322d0 | 8797:4715f3e669f1 |
---|---|
84 | 84 |
85 qc = ngx_quic_get_connection(c); | 85 qc = ngx_quic_get_connection(c); |
86 | 86 |
87 if (f->seqnum < qc->max_retired_seqnum) { | 87 if (f->seqnum < qc->max_retired_seqnum) { |
88 /* | 88 /* |
89 * RFC 9000, 19.15. NEW_CONNECTION_ID Frame | |
90 * | |
89 * An endpoint that receives a NEW_CONNECTION_ID frame with | 91 * An endpoint that receives a NEW_CONNECTION_ID frame with |
90 * a sequence number smaller than the Retire Prior To field | 92 * a sequence number smaller than the Retire Prior To field |
91 * of a previously received NEW_CONNECTION_ID frame MUST send | 93 * of a previously received NEW_CONNECTION_ID frame MUST send |
92 * a corresponding RETIRE_CONNECTION_ID frame that retires | 94 * a corresponding RETIRE_CONNECTION_ID frame that retires |
93 * the newly received connection ID, unless it has already | 95 * the newly received connection ID, unless it has already |
94 * done so for that sequence number. | 96 * done so for that sequence number. |
95 */ | 97 */ |
96 | 98 |
97 if (ngx_quic_send_retire_connection_id(c, f->seqnum) != NGX_OK) { | 99 if (ngx_quic_send_retire_connection_id(c, f->seqnum) != NGX_OK) { |
98 return NGX_ERROR; | 100 return NGX_ERROR; |
115 } | 117 } |
116 } | 118 } |
117 | 119 |
118 if (cid) { | 120 if (cid) { |
119 /* | 121 /* |
120 * Transmission errors, timeouts and retransmissions might cause the | 122 * Transmission errors, timeouts, and retransmissions might cause the |
121 * same NEW_CONNECTION_ID frame to be received multiple times | 123 * same NEW_CONNECTION_ID frame to be received multiple times. |
122 */ | 124 */ |
123 | 125 |
124 if (cid->len != f->len | 126 if (cid->len != f->len |
125 || ngx_strncmp(cid->id, f->cid, f->len) != 0 | 127 || ngx_strncmp(cid->id, f->cid, f->len) != 0 |
126 || ngx_strncmp(cid->sr_token, f->srt, NGX_QUIC_SR_TOKEN_LEN) != 0) | 128 || ngx_strncmp(cid->sr_token, f->srt, NGX_QUIC_SR_TOKEN_LEN) != 0) |
127 { | 129 { |
128 /* | 130 /* |
129 * ..a sequence number is used for different connection IDs, | 131 * ..if a sequence number is used for different connection IDs, |
130 * the endpoint MAY treat that receipt as a connection error | 132 * the endpoint MAY treat that receipt as a connection error |
131 * of type PROTOCOL_VIOLATION. | 133 * of type PROTOCOL_VIOLATION. |
132 */ | 134 */ |
133 qc->error = NGX_QUIC_ERR_PROTOCOL_VIOLATION; | 135 qc->error = NGX_QUIC_ERR_PROTOCOL_VIOLATION; |
134 qc->error_reason = "seqnum refers to different connection id/token"; | 136 qc->error_reason = "seqnum refers to different connection id/token"; |
188 | 190 |
189 done: | 191 done: |
190 | 192 |
191 if (qc->nclient_ids > qc->tp.active_connection_id_limit) { | 193 if (qc->nclient_ids > qc->tp.active_connection_id_limit) { |
192 /* | 194 /* |
195 * RFC 9000, 5.1.1. Issuing Connection IDs | |
196 * | |
193 * After processing a NEW_CONNECTION_ID frame and | 197 * After processing a NEW_CONNECTION_ID frame and |
194 * adding and retiring active connection IDs, if the number of active | 198 * adding and retiring active connection IDs, if the number of active |
195 * connection IDs exceeds the value advertised in its | 199 * connection IDs exceeds the value advertised in its |
196 * active_connection_id_limit transport parameter, an endpoint MUST | 200 * active_connection_id_limit transport parameter, an endpoint MUST |
197 * close the connection with an error of type CONNECTION_ID_LIMIT_ERROR. | 201 * close the connection with an error of type CONNECTION_ID_LIMIT_ERROR. |