Generate and parse extended Google QUIC Error Code in IETF Conn. Close frames.
Add code to prepend "<QuicErrorCode>:" to the error string in IETF QUIC
Connection Close Frames and to detect/parse the string back out and set QuicConnectionCloseFrame::extracted_error_code.
Google QUIC Error Codes are richer than standardized IETF QUIC Error Codes. This CL includes the Google QUIC Error Code in the error details string, allowing
the richer information to be retained when IETF QUIC is used. This is important since it lets us continue to use the current varz's for operational diagnosis/etc.
gfe-relnote: N/A IETF QUIC/v99 code only.
PiperOrigin-RevId: 261676212
Change-Id: Icf9287eb59224bd8bd5e6620827c1ddba67872b3
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h
index 94632c6..a5891f0 100644
--- a/quic/core/quic_framer.h
+++ b/quic/core/quic_framer.h
@@ -1091,6 +1091,14 @@
uint32_t local_ack_delay_exponent_;
};
+// Look for and parse the error code from the "<quic_error_code>:" text that
+// may be present at the start of the CONNECTION_CLOSE error details string.
+// This text, inserted by the peer if it's using Google's QUIC implementation,
+// contains additional error information that narrows down the exact error. If
+// the string is not found, or is not properly formed, it returns
+// ErrorCode::QUIC_IETF_GQUIC_ERROR_MISSING
+QuicErrorCode MaybeExtractQuicErrorCode(QuicStringPiece error_details);
+
} // namespace quic
#endif // QUICHE_QUIC_CORE_QUIC_FRAMER_H_