Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
11 changes: 11 additions & 0 deletions src/core/unittest/FrameTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down