IETF CONNECTION CLOSE code is varint encoded
In the recent (-22) version of the IETF QUIC Internet Draft, the
encoding of the close code in the Connection Close frames was changed
from uint16_t to varint62.
NOTE WELL, this just changes the serialization of the code. The error
code is stored as a uint16_t. A separate CL will change the base type
for the Transport Error Code and Application Error Code.
gfe-relnote: N/A is IETF QUIC/v99 code only.
PiperOrigin-RevId: 258377932
Change-Id: I0be6068b1a2194d4c45d464b393698389a73cb75
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 0009470..29ae36f 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -4676,7 +4676,7 @@
{0x1c}},
// error code
{"Unable to read connection close error code.",
- {0x00, 0x11}},
+ {kVarInt62TwoBytes + 0x00, 0x11}},
{"Unable to read connection close frame type.",
{kVarInt62TwoBytes + 0x12, 0x34 }},
{"Unable to read connection close error details.",
@@ -4747,7 +4747,7 @@
{0x1d}},
// error code
{"Unable to read connection close error code.",
- {0x00, 0x11}},
+ {kVarInt62TwoBytes + 0x00, 0x11}},
{"Unable to read connection close error details.",
{
// error details length
@@ -7927,7 +7927,7 @@
// frame type (IETF_CONNECTION_CLOSE frame)
0x1c,
// error code
- 0x00, 0x11,
+ kVarInt62OneByte + 0x11,
// Frame type within the CONNECTION_CLOSE frame
kVarInt62OneByte + 0x05,
// error details length
@@ -8138,7 +8138,7 @@
// frame type (IETF_CONNECTION_CLOSE frame)
0x1c,
// error code
- 0x00, 0x0a,
+ kVarInt62OneByte + 0x0a,
// Frame type within the CONNECTION_CLOSE frame
kVarInt62OneByte + 0x00,
// error details length
@@ -8212,7 +8212,8 @@
header.packet_number = kPacketNumber;
QuicConnectionCloseFrame app_close_frame;
- app_close_frame.quic_error_code = static_cast<QuicErrorCode>(0x11);
+ app_close_frame.application_error_code =
+ static_cast<uint64_t>(QUIC_INVALID_STREAM_ID);
app_close_frame.error_details = "because I can";
app_close_frame.close_type = IETF_QUIC_APPLICATION_CONNECTION_CLOSE;
@@ -8231,7 +8232,7 @@
// frame type (IETF_APPLICATION_CLOSE frame)
0x1d,
// error code
- 0x00, 0x11,
+ kVarInt62OneByte + 0x11,
// error details length
kVarInt62OneByte + 0x0d,
// error details
@@ -8263,7 +8264,8 @@
header.packet_number = kPacketNumber;
QuicConnectionCloseFrame app_close_frame;
- app_close_frame.quic_error_code = static_cast<QuicErrorCode>(0x11);
+ app_close_frame.application_error_code =
+ static_cast<uint64_t>(QUIC_INVALID_STREAM_ID);
app_close_frame.error_details = std::string(2048, 'A');
app_close_frame.close_type = IETF_QUIC_APPLICATION_CONNECTION_CLOSE;
@@ -8281,7 +8283,7 @@
// frame type (IETF_APPLICATION_CLOSE frame)
0x1d,
// error code
- 0x00, 0x11,
+ kVarInt62OneByte + 0x11,
// error details length
kVarInt62TwoBytes + 0x01, 0x00,
// error details (truncated to 256 bytes)