From 2486e5e75f0049622f3e1dd5a8c100abba4747c2 Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Sun, 7 Nov 2004 02:36:42 +0000
Subject: [PATCH] on some resends, drop our session tags for the peer and
 revert to ElGamal, since they may have restarted or otherwise lost the tags
 delivered to them.

---
 .../java/src/net/i2p/client/streaming/Connection.java        | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
index 73c33ca630..ed2b56e7af 100644
--- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
+++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java
@@ -473,6 +473,11 @@ public class Connection {
                 
                 int numSends = _packet.getNumSends() + 1;
                 
+                // in case things really suck, the other side may have lost thier
+                // session tags (e.g. they restarted), so jump back to ElGamal.
+                if ( (newWindowSize == 1) && (numSends > 2) )
+                    _context.sessionKeyManager().failTags(_remotePeer.getPublicKey());
+                
                 if (_log.shouldLog(Log.WARN))
                     _log.warn("Resend packet " + _packet + " time " + numSends + " (wsize "
                               + newWindowSize + " lifetime " 
-- 
GitLab