Skip to content

Commit

Permalink
Use WriteKey for App Close Check (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
nibanks authored Jul 6, 2021
1 parent 5677bb6 commit 3e40721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ QuicConnTryClose(
if (!ClosedRemotely) {

if ((Flags & QUIC_CLOSE_APPLICATION) &&
QuicCryptoGetNextEncryptLevel(&Connection->Crypto) < QUIC_ENCRYPT_LEVEL_1_RTT) {
Connection->Crypto.TlsState.WriteKey < QUIC_PACKET_KEY_1_RTT) {
//
// Application close can only happen if we are using 1-RTT keys.
// Otherwise we have to send "user_canceled" TLS error code as a
Expand Down
6 changes: 3 additions & 3 deletions src/test/lib/EventTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ QuicTestValidateConnectionEvents1(
ConnValidator Server(
new(std::nothrow) ConnEventValidator* [6] {
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_CONNECTED, 0, true),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_TRANSPORT),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_PEER),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE),
nullptr
},
Expand Down Expand Up @@ -468,7 +468,7 @@ QuicTestValidateConnectionEvents3(
new(std::nothrow) ConnEventValidator* [8] {
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_RESUMED),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_CONNECTED, 0, true, true),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_TRANSPORT),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_PEER),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE),
nullptr
},
Expand Down Expand Up @@ -687,7 +687,7 @@ QuicTestValidateStreamEvents2(
Server.SetExpectedEvents(
new(std::nothrow) ConnEventValidator* [6] {
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_CONNECTED, 0, true),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_TRANSPORT),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_INITIATED_BY_PEER),
new(std::nothrow) ConnEventValidator(QUIC_CONNECTION_EVENT_SHUTDOWN_COMPLETE),
nullptr
});
Expand Down

0 comments on commit 3e40721

Please sign in to comment.