Put Google QUIC Connection Close code in the extracted code field
When processing Google QUIC Connection Close frames, place a copy
of the close code into the QuicConnectionCloseFrame::extracted_error_code
field. In this way, as we migrate through a hybrid Google/IETF QUIC
implementation, the Google QUIC close code is always available in
this field, regardless of the QUIC type in use. This does not change
the existing code's placement of the error code in
QuicConnectionCloseFrame::quic_error_code.
gfe-relnote: N/A, part of a revision of the ConnectionCloseFrame in an earlier CL.
PiperOrigin-RevId: 262114442
Change-Id: Iaa472c1e040dd7de4d5b6a3c2484d5aad1408413
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc
index 99864ad..2c04be8 100644
--- a/quic/core/quic_framer_test.cc
+++ b/quic/core/quic_framer_test.cc
@@ -4889,6 +4889,12 @@
visitor_.connection_close_frame_.transport_close_frame_type);
EXPECT_EQ(QUIC_IETF_GQUIC_ERROR_MISSING,
visitor_.connection_close_frame_.extracted_error_code);
+ } else {
+ // For Google QUIC closes, the error code is copied into
+ // extracted_error_code.
+ EXPECT_EQ(0x11u,
+ static_cast<unsigned>(
+ visitor_.connection_close_frame_.extracted_error_code));
}
ASSERT_EQ(0u, visitor_.ack_frames_.size());
@@ -5050,8 +5056,7 @@
visitor_.connection_close_frame_.transport_close_frame_type);
EXPECT_EQ(17767u, visitor_.connection_close_frame_.extracted_error_code);
} else {
- // QUIC_IETF_GQUIC_ERROR_MISSING is 122
- EXPECT_EQ(122u, visitor_.connection_close_frame_.extracted_error_code);
+ EXPECT_EQ(0x11u, visitor_.connection_close_frame_.extracted_error_code);
}
ASSERT_EQ(0u, visitor_.ack_frames_.size());