From 52623c7dfc8648100483ed2ebce2c02da1bf92a1 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Mon, 9 Mar 2020 19:33:42 -0700 Subject: [PATCH] Count the CID currently in use for ID limit purposes --- quinn-proto/src/connection.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quinn-proto/src/connection.rs b/quinn-proto/src/connection.rs index 00c2d4d3f..9f1f0c412 100644 --- a/quinn-proto/src/connection.rs +++ b/quinn-proto/src/connection.rs @@ -1924,7 +1924,8 @@ where } } - if self.rem_cids.len() as u64 == REM_CID_COUNT { + // Number of active connection IDs is the number saved + the one in use + if self.rem_cids.len() as u64 + 1 == REM_CID_COUNT { return Err(TransportError::CONNECTION_ID_LIMIT_ERROR("")); }