When the CIDT connection option is enabled and an idle timeout is detected just before sending a new request, close the connection with QUIC_CLIENT_REQUEST_IDLE_TIMEOUT instead of QUIC_NETWORK_IDLE_TIMEOUT.

PiperOrigin-RevId: 895582773
diff --git a/quiche/quic/core/quic_connection.cc b/quiche/quic/core/quic_connection.cc
index 8e13c1a..a3f498a 100644
--- a/quiche/quic/core/quic_connection.cc
+++ b/quiche/quic/core/quic_connection.cc
@@ -717,7 +717,7 @@
     QUIC_DLOG(WARNING) << "Idle network deadline has passed";
     if (quic_close_on_idle_timeout_) {
       QUIC_RELOADABLE_FLAG_COUNT(quic_close_on_idle_timeout);
-      CloseConnection(QUIC_NETWORK_IDLE_TIMEOUT,
+      CloseConnection(QUIC_CLIENT_REQUEST_IDLE_TIMEOUT,
                       "Idle network deadline has already passed",
                       ConnectionCloseBehavior::SILENT_CLOSE);
     }
diff --git a/quiche/quic/core/quic_error_codes.cc b/quiche/quic/core/quic_error_codes.cc
index e738773..5f19637 100644
--- a/quiche/quic/core/quic_error_codes.cc
+++ b/quiche/quic/core/quic_error_codes.cc
@@ -273,6 +273,7 @@
     RETURN_STRING_LITERAL(QUIC_ZERO_RTT_REJECTION_LIMIT_REDUCED);
     RETURN_STRING_LITERAL(QUIC_ZERO_RTT_RESUMPTION_LIMIT_REDUCED);
     RETURN_STRING_LITERAL(QUIC_SILENT_IDLE_TIMEOUT);
+    RETURN_STRING_LITERAL(QUIC_CLIENT_REQUEST_IDLE_TIMEOUT);
     RETURN_STRING_LITERAL(QUIC_MISSING_WRITE_KEYS);
     RETURN_STRING_LITERAL(QUIC_KEY_UPDATE_ERROR);
     RETURN_STRING_LITERAL(QUIC_AEAD_LIMIT_REACHED);
@@ -432,6 +433,8 @@
       return {true, static_cast<uint64_t>(NO_IETF_QUIC_ERROR)};
     case QUIC_SILENT_IDLE_TIMEOUT:
       return {true, static_cast<uint64_t>(NO_IETF_QUIC_ERROR)};
+    case QUIC_CLIENT_REQUEST_IDLE_TIMEOUT:
+      return {true, static_cast<uint64_t>(NO_IETF_QUIC_ERROR)};
     case QUIC_HANDSHAKE_TIMEOUT:
       return {true, static_cast<uint64_t>(NO_IETF_QUIC_ERROR)};
     case QUIC_ERROR_MIGRATING_ADDRESS:
diff --git a/quiche/quic/core/quic_error_codes.h b/quiche/quic/core/quic_error_codes.h
index 9409892..d3b00ce 100644
--- a/quiche/quic/core/quic_error_codes.h
+++ b/quiche/quic/core/quic_error_codes.h
@@ -594,6 +594,8 @@
 
   // The connection silently timed out due to no network activity.
   QUIC_SILENT_IDLE_TIMEOUT = 168,
+  // Connection idle timeout detected when about to send a new request.
+  QUIC_CLIENT_REQUEST_IDLE_TIMEOUT = 222,
 
   // Try to write data without the right write keys.
   QUIC_MISSING_WRITE_KEYS = 170,
@@ -647,7 +649,7 @@
   QUIC_CLIENT_LOST_NETWORK_ACCESS = 215,
 
   // No error. Used as bound while iterating.
-  QUIC_LAST_ERROR = 222,
+  QUIC_LAST_ERROR = 223,
 };
 // QuicErrorCodes is encoded as four octets on-the-wire when doing Google QUIC,
 // or a varint62 when doing IETF QUIC. Ensure that its value does not exceed