summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2020-06-01 19:16:44 +0300
committerSergey Kandaurov <pluknet@nginx.com>2020-06-01 19:16:44 +0300
commit59782257222b7a08cace201456cf2886b2a98067 (patch)
tree31cbec5a9b37c0f60214e688f09189bac05f002c /src
parent22297afd7924d00440105bc440aa4f67fde380fe (diff)
downloadnginx-59782257222b7a08cace201456cf2886b2a98067.tar.gz
nginx-59782257222b7a08cace201456cf2886b2a98067.tar.bz2
Fixed transport parameters on a new connection with a valid token.
Previously, the retry transport parameter was sent regardless.
Diffstat (limited to 'src')
-rw-r--r--src/event/ngx_event_quic.c5
-rw-r--r--src/event/ngx_event_quic_transport.c16
2 files changed, 13 insertions, 8 deletions
diff --git a/src/event/ngx_event_quic.c b/src/event/ngx_event_quic.c
index 37b3e4c6f..cd5b530c9 100644
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -652,7 +652,9 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp,
return NGX_ERROR;
}
+#if (NGX_QUIC_DRAFT_VERSION >= 28)
qc->tp.original_dcid = c->quic->odcid;
+#endif
qc->tp.initial_scid = c->quic->dcid;
qc->scid.len = pkt->scid.len;
@@ -796,6 +798,9 @@ ngx_quic_retry(ngx_connection_t *c)
}
c->quic->token = token;
+#if (NGX_QUIC_DRAFT_VERSION < 28)
+ c->quic->tp.original_dcid = c->quic->odcid;
+#endif
c->quic->tp.retry_scid = c->quic->dcid;
c->quic->in_retry = 1;
diff --git a/src/event/ngx_event_quic_transport.c b/src/event/ngx_event_quic_transport.c
index 00df78a59..3b64aef6d 100644
--- a/src/event/ngx_event_quic_transport.c
+++ b/src/event/ngx_event_quic_transport.c
@@ -1673,15 +1673,15 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
#if (NGX_QUIC_DRAFT_VERSION >= 28)
len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid);
len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid);
-#endif
- if (tp->retry) {
-#if (NGX_QUIC_DRAFT_VERSION >= 28)
+ if (tp->retry_scid.len) {
len += ngx_quic_tp_strlen(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid);
+ }
#else
+ if (tp->original_dcid.len) {
len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid);
-#endif
}
+#endif
if (pos == NULL) {
return len;
@@ -1714,15 +1714,15 @@ ngx_quic_create_transport_params(u_char *pos, u_char *end, ngx_quic_tp_t *tp)
#if (NGX_QUIC_DRAFT_VERSION >= 28)
ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid);
ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid);
-#endif
- if (tp->retry) {
-#if (NGX_QUIC_DRAFT_VERSION >= 28)
+ if (tp->retry_scid.len) {
ngx_quic_tp_str(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid);
+ }
#else
+ if (tp->original_dcid.len) {
ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid);
-#endif
}
+#endif
return p - pos;
}