Mercurial > hg > nginx-quic
comparison src/event/quic/ngx_event_quic_transport.c @ 8321:81bb3a690c10 quic
QUIC: removed support prior to draft-29.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 18 Feb 2021 19:21:09 +0300 |
parents | d710c457171c |
children | 44b4c6180106 |
comparison
equal
deleted
inserted
replaced
8320:98bacfc65c61 | 8321:81bb3a690c10 |
---|---|
128 uint32_t ngx_quic_versions[] = { | 128 uint32_t ngx_quic_versions[] = { |
129 #if (NGX_QUIC_DRAFT_VERSION >= 33) | 129 #if (NGX_QUIC_DRAFT_VERSION >= 33) |
130 /* QUICv1 */ | 130 /* QUICv1 */ |
131 0x00000001, | 131 0x00000001, |
132 NGX_QUIC_VERSION(33), | 132 NGX_QUIC_VERSION(33), |
133 #elif (NGX_QUIC_DRAFT_VERSION >= 29) | 133 #else |
134 NGX_QUIC_VERSION(29), | 134 NGX_QUIC_VERSION(29), |
135 NGX_QUIC_VERSION(30), | 135 NGX_QUIC_VERSION(30), |
136 NGX_QUIC_VERSION(31), | 136 NGX_QUIC_VERSION(31), |
137 NGX_QUIC_VERSION(32), | 137 NGX_QUIC_VERSION(32), |
138 #else | |
139 NGX_QUIC_VERSION(NGX_QUIC_DRAFT_VERSION) | |
140 #endif | 138 #endif |
141 }; | 139 }; |
142 | 140 |
143 #define NGX_QUIC_NVERSIONS \ | 141 #define NGX_QUIC_NVERSIONS \ |
144 (sizeof(ngx_quic_versions) / sizeof(ngx_quic_versions[0])) | 142 (sizeof(ngx_quic_versions) / sizeof(ngx_quic_versions[0])) |
1123 /* STREAMS_BLOCKED2 */ 0x3, | 1121 /* STREAMS_BLOCKED2 */ 0x3, |
1124 /* NEW_CONNECTION_ID */ 0x3, | 1122 /* NEW_CONNECTION_ID */ 0x3, |
1125 /* RETIRE_CONNECTION_ID */ 0x3, | 1123 /* RETIRE_CONNECTION_ID */ 0x3, |
1126 /* PATH_CHALLENGE */ 0x3, | 1124 /* PATH_CHALLENGE */ 0x3, |
1127 /* PATH_RESPONSE */ 0x3, | 1125 /* PATH_RESPONSE */ 0x3, |
1128 #if (NGX_QUIC_DRAFT_VERSION >= 28) | |
1129 /* CONNECTION_CLOSE */ 0xF, | 1126 /* CONNECTION_CLOSE */ 0xF, |
1130 /* CONNECTION_CLOSE2 */ 0x3, | 1127 /* CONNECTION_CLOSE2 */ 0x3, |
1131 #else | |
1132 /* CONNECTION_CLOSE */ 0xD, | |
1133 /* CONNECTION_CLOSE2 */ 0x1, | |
1134 #endif | |
1135 /* HANDSHAKE_DONE */ 0x0, /* only sent by server */ | 1128 /* HANDSHAKE_DONE */ 0x0, /* only sent by server */ |
1136 }; | 1129 }; |
1137 | 1130 |
1138 if (ngx_quic_long_pkt(pkt->flags)) { | 1131 if (ngx_quic_long_pkt(pkt->flags)) { |
1139 | 1132 |
1743 | 1736 |
1744 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, | 1737 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, log, 0, |
1745 "quic tp active_connection_id_limit:%ui", | 1738 "quic tp active_connection_id_limit:%ui", |
1746 tp->active_connection_id_limit); | 1739 tp->active_connection_id_limit); |
1747 | 1740 |
1748 #if (NGX_QUIC_DRAFT_VERSION >= 28) | |
1749 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0, | 1741 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0, |
1750 "quic tp initial source_connection_id len:%uz %xV", | 1742 "quic tp initial source_connection_id len:%uz %xV", |
1751 tp->initial_scid.len, &tp->initial_scid); | 1743 tp->initial_scid.len, &tp->initial_scid); |
1752 #endif | |
1753 | 1744 |
1754 return NGX_OK; | 1745 return NGX_OK; |
1755 } | 1746 } |
1756 | 1747 |
1757 | 1748 |
1944 tp->max_ack_delay); | 1935 tp->max_ack_delay); |
1945 | 1936 |
1946 len += ngx_quic_tp_len(NGX_QUIC_TP_ACK_DELAY_EXPONENT, | 1937 len += ngx_quic_tp_len(NGX_QUIC_TP_ACK_DELAY_EXPONENT, |
1947 tp->ack_delay_exponent); | 1938 tp->ack_delay_exponent); |
1948 | 1939 |
1949 #if (NGX_QUIC_DRAFT_VERSION >= 28) | |
1950 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1940 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
1951 len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); | 1941 len += ngx_quic_tp_strlen(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); |
1952 | 1942 |
1953 if (tp->retry_scid.len) { | 1943 if (tp->retry_scid.len) { |
1954 len += ngx_quic_tp_strlen(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); | 1944 len += ngx_quic_tp_strlen(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); |
1955 } | 1945 } |
1956 #else | |
1957 if (tp->original_dcid.len) { | |
1958 len += ngx_quic_tp_strlen(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | |
1959 } | |
1960 #endif | |
1961 | 1946 |
1962 len += ngx_quic_varint_len(NGX_QUIC_TP_SR_TOKEN); | 1947 len += ngx_quic_varint_len(NGX_QUIC_TP_SR_TOKEN); |
1963 len += ngx_quic_varint_len(NGX_QUIC_SR_TOKEN_LEN); | 1948 len += ngx_quic_varint_len(NGX_QUIC_SR_TOKEN_LEN); |
1964 len += NGX_QUIC_SR_TOKEN_LEN; | 1949 len += NGX_QUIC_SR_TOKEN_LEN; |
1965 | 1950 |
2003 tp->max_ack_delay); | 1988 tp->max_ack_delay); |
2004 | 1989 |
2005 ngx_quic_tp_vint(NGX_QUIC_TP_ACK_DELAY_EXPONENT, | 1990 ngx_quic_tp_vint(NGX_QUIC_TP_ACK_DELAY_EXPONENT, |
2006 tp->ack_delay_exponent); | 1991 tp->ack_delay_exponent); |
2007 | 1992 |
2008 #if (NGX_QUIC_DRAFT_VERSION >= 28) | |
2009 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | 1993 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); |
2010 ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); | 1994 ngx_quic_tp_str(NGX_QUIC_TP_INITIAL_SCID, tp->initial_scid); |
2011 | 1995 |
2012 if (tp->retry_scid.len) { | 1996 if (tp->retry_scid.len) { |
2013 ngx_quic_tp_str(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); | 1997 ngx_quic_tp_str(NGX_QUIC_TP_RETRY_SCID, tp->retry_scid); |
2014 } | 1998 } |
2015 #else | |
2016 if (tp->original_dcid.len) { | |
2017 ngx_quic_tp_str(NGX_QUIC_TP_ORIGINAL_DCID, tp->original_dcid); | |
2018 } | |
2019 #endif | |
2020 | 1999 |
2021 ngx_quic_build_int(&p, NGX_QUIC_TP_SR_TOKEN); | 2000 ngx_quic_build_int(&p, NGX_QUIC_TP_SR_TOKEN); |
2022 ngx_quic_build_int(&p, NGX_QUIC_SR_TOKEN_LEN); | 2001 ngx_quic_build_int(&p, NGX_QUIC_SR_TOKEN_LEN); |
2023 p = ngx_cpymem(p, tp->sr_token, NGX_QUIC_SR_TOKEN_LEN); | 2002 p = ngx_cpymem(p, tp->sr_token, NGX_QUIC_SR_TOKEN_LEN); |
2024 | 2003 |