forked from I2P_Developers/i2p.i2p
SSU: Fix OMF looping when timer isn't cancelled after last message acked
Push out timer when no more bandwidth available Workarounds for now, more changes to follow
This commit is contained in:
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 3;
|
||||
public final static long BUILD = 4;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
||||
@@ -1491,7 +1491,8 @@ public class PeerState {
|
||||
synchronized(this) {
|
||||
retransmitTimer = _retransmitTimer;
|
||||
}
|
||||
List<OutboundMessageState> rv = allocateSend2(retransmitTimer > 0 && now >= retransmitTimer, now);
|
||||
boolean canSendOld = retransmitTimer > 0 && now >= retransmitTimer;
|
||||
List<OutboundMessageState> rv = allocateSend2(canSendOld, now);
|
||||
if (rv != null && !rv.isEmpty()) {
|
||||
synchronized(this) {
|
||||
long old = _retransmitTimer;
|
||||
@@ -1500,6 +1501,18 @@ public class PeerState {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(_remotePeer + " allocated " + rv.size() + " pushing retransmitter from " + old + " to " + _retransmitTimer);
|
||||
}
|
||||
} else if (canSendOld) {
|
||||
// failsafe - push out or cancel timer to prevent looping
|
||||
boolean isEmpty;
|
||||
synchronized (_outboundMessages) {
|
||||
isEmpty = _outboundMessages.isEmpty();
|
||||
}
|
||||
synchronized(this) {
|
||||
if (isEmpty)
|
||||
_retransmitTimer = 0;
|
||||
else
|
||||
_retransmitTimer = now + 250;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user