Merge branch 'choking-retransmission-fix' into 'master'

Prevent the sender from sending too far ahead of an unacked packet

See merge request i2p-hackers/i2p.i2p!35
This commit is contained in:
Zlatin Balevsky
2021-09-02 17:26:54 +00:00

View File

@@ -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))