forked from I2P_Developers/i2p.i2p
SSU: Fix sent msg count, broken in last checkin
Increase sent threshold from 1 to 2 for mayDisconnect(), because we send both our RI and a DeliveryStatusMessage Log tweak
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 = 16;
|
||||
public final static long BUILD = 17;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
@ -293,6 +293,7 @@ class OutboundMessageState implements CDPQEntry {
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder(256);
|
||||
buf.append("OB Message ").append(_i2npMessage.getUniqueId());
|
||||
buf.append(" type ").append(_i2npMessage.getType());
|
||||
buf.append(" with ").append(_numFragments).append(" fragments");
|
||||
buf.append(" of size ").append(_messageBuf.length);
|
||||
buf.append(" volleys: ").append(_maxSends);
|
||||
@ -304,6 +305,7 @@ class OutboundMessageState implements CDPQEntry {
|
||||
buf.append(i).append(' ');
|
||||
}
|
||||
}
|
||||
buf.append(" to: ").append(_peer.toString());
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
@ -1180,7 +1180,6 @@ class PeerState {
|
||||
_sendWindowBytesRemaining = _sendWindowBytes;
|
||||
//}
|
||||
|
||||
_messagesSent++;
|
||||
if (numSends < 2) {
|
||||
// caller synchs
|
||||
//synchronized (this) {
|
||||
|
@ -2442,7 +2442,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
public void mayDisconnect(final Hash peer) {
|
||||
final PeerState ps = _peersByIdent.get(peer);
|
||||
if (ps != null && ps.isInbound() &&
|
||||
ps.getMessagesReceived() <= 2 && ps.getMessagesSent() <= 1) {
|
||||
ps.getMessagesReceived() <= 2 && ps.getMessagesSent() <= 2) {
|
||||
ps.setMayDisconnect();
|
||||
}
|
||||
}
|
||||
@ -2883,7 +2883,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
|
||||
if (peer.getWeRelayToThemAs() > 0 || peer.getIntroducerTime() > pingCutoff) {
|
||||
inactivityCutoff = longInactivityCutoff;
|
||||
} else if (!haveCap && peer.getMayDisconnect() &&
|
||||
peer.getMessagesReceived() <= 2 && peer.getMessagesSent() <= 1) {
|
||||
peer.getMessagesReceived() <= 2 && peer.getMessagesSent() <= 2) {
|
||||
inactivityCutoff = mayDisconCutoff;
|
||||
} else {
|
||||
inactivityCutoff = shortInactivityCutoff;
|
||||
|
Reference in New Issue
Block a user