forked from I2P_Developers/i2p.i2p
Revert PeerState.java temporarily to allow for propagation from i2p.i2p
This commit is contained in:
@@ -11,12 +11,14 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Queue;
|
import java.util.Queue;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import net.i2p.data.Hash;
|
import net.i2p.data.Hash;
|
||||||
import net.i2p.data.SessionKey;
|
import net.i2p.data.SessionKey;
|
||||||
import net.i2p.router.OutNetMessage;
|
import net.i2p.router.OutNetMessage;
|
||||||
import net.i2p.router.RouterContext;
|
import net.i2p.router.RouterContext;
|
||||||
import net.i2p.router.util.CachedIteratorCollection;
|
import net.i2p.router.util.CachedIteratorArrayList;
|
||||||
|
import net.i2p.router.util.CoDelPriorityBlockingQueue;
|
||||||
import net.i2p.router.util.PriBlockingQueue;
|
import net.i2p.router.util.PriBlockingQueue;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
import net.i2p.util.ConcurrentHashSet;
|
import net.i2p.util.ConcurrentHashSet;
|
||||||
@@ -208,7 +210,7 @@ public class PeerState {
|
|||||||
* Mostly messages that have been transmitted and are awaiting acknowledgement,
|
* Mostly messages that have been transmitted and are awaiting acknowledgement,
|
||||||
* although there could be some that have not been sent yet.
|
* although there could be some that have not been sent yet.
|
||||||
*/
|
*/
|
||||||
private final CachedIteratorCollection<OutboundMessageState> _outboundMessages;
|
private final List<OutboundMessageState> _outboundMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Priority queue of messages that have not yet been sent.
|
* Priority queue of messages that have not yet been sent.
|
||||||
@@ -368,7 +370,7 @@ public class PeerState {
|
|||||||
_rtt = INIT_RTT;
|
_rtt = INIT_RTT;
|
||||||
_rttDeviation = _rtt;
|
_rttDeviation = _rtt;
|
||||||
_inboundMessages = new HashMap<Long, InboundMessageState>(8);
|
_inboundMessages = new HashMap<Long, InboundMessageState>(8);
|
||||||
_outboundMessages = new CachedIteratorCollection<OutboundMessageState>();
|
_outboundMessages = new CachedIteratorArrayList<OutboundMessageState>(32);
|
||||||
//_outboundQueue = new CoDelPriorityBlockingQueue(ctx, "UDP-PeerState", 32);
|
//_outboundQueue = new CoDelPriorityBlockingQueue(ctx, "UDP-PeerState", 32);
|
||||||
_outboundQueue = new PriBlockingQueue<OutboundMessageState>(ctx, "UDP-PeerState", 32);
|
_outboundQueue = new PriBlockingQueue<OutboundMessageState>(ctx, "UDP-PeerState", 32);
|
||||||
// all createRateStat() moved to EstablishmentManager
|
// all createRateStat() moved to EstablishmentManager
|
||||||
@@ -1566,7 +1568,7 @@ public class PeerState {
|
|||||||
if (_dead) {
|
if (_dead) {
|
||||||
dropOutbound();
|
dropOutbound();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
List<OutboundMessageState> succeeded = null;
|
List<OutboundMessageState> succeeded = null;
|
||||||
@@ -1584,7 +1586,6 @@ public class PeerState {
|
|||||||
iter.remove();
|
iter.remove();
|
||||||
if (_retransmitter == state)
|
if (_retransmitter == state)
|
||||||
_retransmitter = null;
|
_retransmitter = null;
|
||||||
_log.debug("CachedIteratorCollection: sendFailed update" + state);
|
|
||||||
_context.statManager().addRateData("udp.sendFailed", state.getPushCount());
|
_context.statManager().addRateData("udp.sendFailed", state.getPushCount());
|
||||||
if (failed == null) failed = new ArrayList<OutboundMessageState>(4);
|
if (failed == null) failed = new ArrayList<OutboundMessageState>(4);
|
||||||
failed.add(state);
|
failed.add(state);
|
||||||
@@ -1592,7 +1593,6 @@ public class PeerState {
|
|||||||
iter.remove();
|
iter.remove();
|
||||||
if (state == _retransmitter)
|
if (state == _retransmitter)
|
||||||
_retransmitter = null;
|
_retransmitter = null;
|
||||||
_log.debug("CachedIteratorCollection: sendAggressiveFailed update" + state);
|
|
||||||
_context.statManager().addRateData("udp.sendAggressiveFailed", state.getPushCount());
|
_context.statManager().addRateData("udp.sendAggressiveFailed", state.getPushCount());
|
||||||
if (failed == null) failed = new ArrayList<OutboundMessageState>(4);
|
if (failed == null) failed = new ArrayList<OutboundMessageState>(4);
|
||||||
failed.add(state);
|
failed.add(state);
|
||||||
@@ -1904,7 +1904,6 @@ public class PeerState {
|
|||||||
_context.statManager().addRateData("udp.sendConfirmFragments", state.getFragmentCount());
|
_context.statManager().addRateData("udp.sendConfirmFragments", state.getFragmentCount());
|
||||||
_context.statManager().addRateData("udp.sendConfirmVolley", numSends);
|
_context.statManager().addRateData("udp.sendConfirmVolley", numSends);
|
||||||
_transport.succeeded(state);
|
_transport.succeeded(state);
|
||||||
int numFragments = state.getFragmentCount();
|
|
||||||
// this adjusts the rtt/rto/window/etc
|
// this adjusts the rtt/rto/window/etc
|
||||||
messageACKed(state.getMessageSize(), state.getLifetime(), numSends);
|
messageACKed(state.getMessageSize(), state.getLifetime(), numSends);
|
||||||
//if (getSendWindowBytesRemaining() > 0)
|
//if (getSendWindowBytesRemaining() > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user