From 595556c39f897941b641a0a412bba45a5043ab51 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Fri, 28 Sep 2012 19:06:39 +0000
Subject: [PATCH]  * SessionKeyManager: Store original tagset size for
 debugging

---
 .../net/i2p/crypto/TransientSessionKeyManager.java    | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
index e5f9a34667..2f9e04b36b 100644
--- a/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
+++ b/core/java/src/net/i2p/crypto/TransientSessionKeyManager.java
@@ -744,7 +744,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
                 total += size;
                 buf.append("<li><b>ID: ").append(ts.getID())
                    .append(" Received:</b> ").append(DataHelper.formatDuration2(now - ts.getDate())).append(" ago with ");
-                buf.append(size).append(" tags remaining</li>");
+                buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining</li>");
             }
             buf.append("</ul></td></tr>\n");
             out.write(buf.toString());
@@ -774,7 +774,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
                 total += size;
                 buf.append("<li><b>ID: ").append(ts.getID())
                    .append(" Sent:</b> ").append(DataHelper.formatDuration2(now - ts.getDate())).append(" ago with ");
-                buf.append(size).append(" tags remaining; acked? ").append(ts.getAcked()).append("</li>");
+                buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining; acked? ").append(ts.getAcked()).append("</li>");
             }
             buf.append("</ul></td></tr>\n");
             out.write(buf.toString());
@@ -1084,6 +1084,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
         private final SessionKey _key;
         private final long _date;
         private final int _id;
+        private final int _origSize;
         //private Exception _createdBy;
         /** did we get an ack for this tagset? Only for outbound tagsets */
         private boolean _acked;
@@ -1095,6 +1096,7 @@ public class TransientSessionKeyManager extends SessionKeyManager {
             _key = key;
             _date = date;
             _id = id;
+            _origSize = tags.size();
             //if (true) {
             //    long now = I2PAppContext.getGlobalContext().clock().now();
             //    _createdBy = new Exception("Created by: key=" + _key.toBase64() + " on " 
@@ -1108,6 +1110,11 @@ public class TransientSessionKeyManager extends SessionKeyManager {
             return _date;
         }
 
+        /** @since 0.9.3 for debugging */
+        public long getOriginalSize() {
+            return _origSize;
+        }
+
         //void setDate(long when) {
         //    _date = when;
         //}
-- 
GitLab