From f77570b621c163800faae2b211a777c2db6b297f Mon Sep 17 00:00:00 2001 From: Sai Asish Y Date: Fri, 13 Nov 2026 11:26:19 -0800 Subject: [PATCH] Fix QUIC_ERROR_APPLICATION_ERROR to use the RFC 9000 value 0xC Signed-off-by: Sai Asish Y --- src/core/frame.h | 2 +- src/core/unittest/FrameTest.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/frame.h b/src/core/frame.h index 5633327403..d38a2f330d 100644 --- a/src/core/frame.h +++ b/src/core/frame.h @@ -71,7 +71,7 @@ extern "C" { // // The application or application protocol caused the connection to be closed. // -#define QUIC_ERROR_APPLICATION_ERROR 0xB +#define QUIC_ERROR_APPLICATION_ERROR 0xC // // An endpoint has received more data in CRYPTO frames than it can buffer. // diff --git a/src/core/unittest/FrameTest.cpp b/src/core/unittest/FrameTest.cpp index 3d565ecb34..ddc1768850 100644 --- a/src/core/unittest/FrameTest.cpp +++ b/src/core/unittest/FrameTest.cpp @@ -1250,6 +1250,17 @@ INSTANTIATE_TEST_SUITE_P( return "QUICClosed"; }); +TEST(FrameTest, ConnectionCloseApplicationErrorEncode) +{ + QUIC_CONNECTION_CLOSE_EX Frame = {FALSE, QUIC_ERROR_APPLICATION_ERROR, 0, 0, nullptr}; + uint8_t Buffer[4]; + uint16_t Offset = 0; + + ASSERT_TRUE(QuicConnCloseFrameEncode(&Frame, &Offset, (uint16_t)sizeof(Buffer), Buffer)); + ASSERT_EQ(Buffer[0], QUIC_FRAME_CONNECTION_CLOSE); + ASSERT_EQ(Buffer[1], 0x0c); // APPLICATION_ERROR, RFC 9000 Section 20.1 +} + struct ConnectionCloseFrameParams { uint8_t Buffer[5]; uint16_t BufferLength;