Save all data from received IETF Connection Close frames
Save all data from received IETF connection close frames.
Also removes the QuicErrorCode that was prepended to the error details phrase. The phrase is the same on both the CONNECTION_CLOSE sender and receiver.
gfe-relnote: N/A rearranges existing code, new code is V99/IETF QUIC only.
PiperOrigin-RevId: 265442745
Change-Id: I1d487fc93f90863629e29b863b32c6ab9c6377e1
diff --git a/quic/core/quic_framer.h b/quic/core/quic_framer.h
index c749f04..5cfba86 100644
--- a/quic/core/quic_framer.h
+++ b/quic/core/quic_framer.h
@@ -1103,11 +1103,13 @@
// 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
-QUIC_EXPORT_PRIVATE QuicErrorCode
-MaybeExtractQuicErrorCode(QuicStringPiece error_details);
+// contains additional error information that narrows down the exact error. The
+// extracted error code and (possibly updated) error_details string are returned
+// in |*frame|. If an error code is not found in the error details then the
+// extracted_error_code is set to QuicErrorCode::QUIC_IETF_GQUIC_ERROR_MISSING.
+// If there is an error code in the string then it is removed from the string.
+QUIC_EXPORT_PRIVATE void MaybeExtractQuicErrorCode(
+ QuicConnectionCloseFrame* frame);
} // namespace quic