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 d9a959d2c..45b5624f3 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java @@ -758,8 +758,12 @@ public class Connection { // 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) ) + int failTagsAt = _options.getMaxResends() - 1; + if ( (newWindowSize == 1) && (numSends == failTagsAt) ) { + if (_log.shouldLog(Log.WARN)) + _log.warn("Optimistically failing tags at resend " + numSends); _context.sessionKeyManager().failTags(_remotePeer.getPublicKey()); + } if (_log.shouldLog(Log.WARN)) _log.warn("Resend packet " + _packet + " time " + numSends + diff --git a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java index b28262607..7ffbf5502 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketFull.java @@ -19,12 +19,13 @@ public class I2PSocketFull implements I2PSocket { } public void close() throws IOException { - if (_connection == null) return; - if (_connection.getIsConnected()) { - OutputStream out = _connection.getOutputStream(); + Connection c = _connection; + if (c == null) return; + if (c.getIsConnected()) { + OutputStream out = c.getOutputStream(); if (out != null) out.close(); - _connection.disconnect(true); + c.disconnect(true); } else { //throw new IOException("Not connected"); }