Remove redundant connection check.
The check already exists in CloseConnection(). All other connection close code paths don't check connection beforehand. And these two paths should do the same.
gfe-relnote: code cleanup, not protected.
PiperOrigin-RevId: 267229004
Change-Id: I197439d426bb181d87b428315b10af11cedbeabc
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 57de377..23935b3 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -1124,11 +1124,9 @@
QUIC_LOG_FIRST_N(ERROR, 1)
<< "Peer sent us an invalid stream flow control send window: "
<< new_window << ", below minimum: " << kMinimumFlowControlSendWindow;
- if (connection_->connected()) {
- connection_->CloseConnection(
- QUIC_FLOW_CONTROL_INVALID_WINDOW, "New stream window too low",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- }
+ connection_->CloseConnection(
+ QUIC_FLOW_CONTROL_INVALID_WINDOW, "New stream window too low",
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
@@ -1147,11 +1145,9 @@
QUIC_LOG_FIRST_N(ERROR, 1)
<< "Peer sent us an invalid session flow control send window: "
<< new_window << ", below default: " << kMinimumFlowControlSendWindow;
- if (connection_->connected()) {
- connection_->CloseConnection(
- QUIC_FLOW_CONTROL_INVALID_WINDOW, "New connection window too low",
- ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
- }
+ connection_->CloseConnection(
+ QUIC_FLOW_CONTROL_INVALID_WINDOW, "New connection window too low",
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}