Ignore Retry packets when connection is shutting down.
@@ -3153,6 +3153,14 @@ QuicConnRecvRetry(
return;
}
+ //
+ // Make sure the connection is still active
+ //
+ if (Connection->State.ClosedLocally || Connection->State.ClosedRemotely) {
+ QuicPacketLogDrop(Connection, Packet, "Retry while shutting down");
+ return;
+ }
+
//
// Decode and validate the Retry packet.
//
@@ -3986,6 +3994,11 @@ QuicConnRecvFrames(
uint16_t PayloadLength = Packet->PayloadLength;
uint64_t RecvTime = CxPlatTimeUs64();
+ if (!QuicConnIsServer(Connection) &&
+ !Connection->State.GotFirstServerResponse) {
+ Connection->State.GotFirstServerResponse = TRUE;
+ }
+
uint16_t Offset = 0;
while (Offset < PayloadLength) {
@@ -4807,11 +4820,6 @@ QuicConnRecvFrames(
Done:
- if (!QuicConnIsServer(Connection) &&
- !Connection->State.GotFirstServerResponse) {
- Connection->State.GotFirstServerResponse = TRUE;
- }
-
if (UpdatedFlowControl) {
QuicConnLogOutFlowStats(Connection);
}
