From de7b8db504811573f2bc90e534e7ef816514638c Mon Sep 17 00:00:00 2001
From: zzz <zzz@i2pmail.org>
Date: Wed, 1 Feb 2023 08:01:35 -0500
Subject: [PATCH] Console: Don't list same client SKM twice on /debug for
 subsessions

---
 apps/routerconsole/jsp/debug.jsp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/routerconsole/jsp/debug.jsp b/apps/routerconsole/jsp/debug.jsp
index b621ae6972..66e2ebf58c 100644
--- a/apps/routerconsole/jsp/debug.jsp
+++ b/apps/routerconsole/jsp/debug.jsp
@@ -83,6 +83,7 @@ if (dd == null || dd.equals("0")) {
 
     out.print("<h2>Client Session Key Managers</h2>");
     java.util.Set<net.i2p.data.Destination> clients = ctx.clientManager().listClients();
+    java.util.Set<net.i2p.crypto.SessionKeyManager> skms = new java.util.HashSet<net.i2p.crypto.SessionKeyManager>(clients.size());
     int i = 0;
     for (net.i2p.data.Destination dest : clients) {
         net.i2p.data.Hash h = dest.calculateHash();
@@ -100,7 +101,10 @@ if (dd == null || dd.equals("0")) {
                 out.print("<font size=\"-2\">" + dest.toBase32() + "</font>");
             }
             out.print(" Session Key Manager</h2>");
-            skm.renderStatusHTML(out);
+            if (skms.add(skm))
+                skm.renderStatusHTML(out);
+            else
+                out.print("<p>See Session Key Manager for alternate destination above</p>");
             out.print("</div>");
         }
     }
-- 
GitLab