From 941ab6fd568e08d5a846e9161d89b7725358c596 Mon Sep 17 00:00:00 2001
From: huitema <huitema@huitema.net>
Date: Tue, 18 Dec 2018 21:10:35 -0800
Subject: [PATCH] Revert "Count usage of remote cnxid before retiring."

This reverts commit 1d83c55ccde77139a173445270948e3b8ebb5d35.
---
 picoquic/picoquic_internal.h |  1 -
 picoquic/quicctx.c           | 23 +----------------------
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/picoquic/picoquic_internal.h b/picoquic/picoquic_internal.h
index 395ee229..7bdcd260 100644
--- a/picoquic/picoquic_internal.h
+++ b/picoquic/picoquic_internal.h
@@ -770,7 +770,6 @@ void picoquic_register_path(picoquic_cnx_t* cnx, picoquic_path_t * path_x);
 void picoquic_delete_path(picoquic_cnx_t* cnx, int path_index);
 void picoquic_demote_path(picoquic_cnx_t* cnx, int path_index, uint64_t current_time);
 void picoquic_promote_path_to_default(picoquic_cnx_t* cnx, int path_index, uint64_t current_time);
-int picoquic_count_remote_connection_id_ref(picoquic_cnx_t* cnx, picoquic_connection_id_t * cid);
 void picoquic_delete_abandoned_paths(picoquic_cnx_t* cnx, uint64_t current_time, uint64_t * next_wake_time);
 
 /* Management of the CNX-ID stash */
diff --git a/picoquic/quicctx.c b/picoquic/quicctx.c
index 1a1ee2d6..e1948fc7 100644
--- a/picoquic/quicctx.c
+++ b/picoquic/quicctx.c
@@ -859,26 +859,6 @@ void picoquic_delete_path(picoquic_cnx_t* cnx, int path_index)
     cnx->path[cnx->nb_paths] = NULL;
 }
 
-/*
- * Connection ID may be used on more than one path.
- * Provide a count of how many such values we see.
- */
-
-int picoquic_count_remote_connection_id_ref(picoquic_cnx_t* cnx, picoquic_connection_id_t * cid)
-{
-    int count = 0;
-    int path_index_current = 0;
-
-    while (path_index_current < cnx->nb_paths) {
-        if (picoquic_compare_connection_id(cid, &cnx->path[path_index_current]->remote_cnxid) == 0) {
-            count++;
-        }
-        path_index_current++;
-    }
-
-    return count;
-}
-
 /*
  * Path challenges may be abandoned if they are tried too many times without success. 
  */
@@ -915,8 +895,7 @@ void picoquic_delete_abandoned_paths(picoquic_cnx_t* cnx, uint64_t current_time,
 
     while (cnx->nb_paths > path_index_good) {
         int d_path = cnx->nb_paths - 1;
-        if (!picoquic_is_connection_id_null(cnx->path[d_path]->remote_cnxid) &&
-            picoquic_count_remote_connection_id_ref(cnx, &cnx->path[d_path]->remote_cnxid) == 1) {
+        if (!picoquic_is_connection_id_null(cnx->path[d_path]->remote_cnxid)) {
             (void)picoquic_queue_retire_connection_id_frame(cnx, cnx->path[d_path]->remote_cnxid_sequence);
         }
         picoquic_delete_path(cnx, d_path);
-- 
GitLab