From 1ae05103e494d084229b9b3bd19457b38e6e903e Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Thu, 2 Sep 2021 18:22:12 +0100 Subject: [PATCH] Prevent the sender from sending too far ahead of an unacked packet --- .../java/src/net/i2p/client/streaming/impl/Connection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java index aba792193..681aca950 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/impl/Connection.java @@ -233,7 +233,7 @@ class Connection { int wsz = _options.getWindowSize(); if (_isChoked || unacked >= wsz || _activeResends.get() >= (wsz + 1) / 2 || - _lastSendId.get() - _highestAckedThrough >= Math.max(MAX_WINDOW_SIZE, 2 * wsz)) { + _lastSendId.get() - _highestAckedThrough >= Math.min(MAX_WINDOW_SIZE, 2 * wsz)) { if (timeoutMs > 0) { if (timeLeft <= 0) { if (_log.shouldLog(Log.INFO))