From a0a3622f16999645a6a51cf35c4debee094162e5 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Fri, 26 Nov 2010 15:04:58 +0000 Subject: [PATCH] remove unneeded initializers --- .../transport/udp/InboundEstablishState.java | 3 -- .../transport/udp/OutboundEstablishState.java | 2 -- .../udp/OutboundMessageFragments.java | 1 - .../transport/udp/OutboundMessageState.java | 3 -- .../i2p/router/transport/udp/PeerState.java | 28 ------------------- .../router/transport/udp/PeerTestManager.java | 2 -- .../TimedWeightedPriorityMessageQueue.java | 1 - .../router/transport/udp/UDPTransport.java | 1 - 8 files changed, 41 deletions(-) diff --git a/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java b/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java index ea40c616c8..334a075fba 100644 --- a/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java +++ b/router/java/src/net/i2p/router/transport/udp/InboundEstablishState.java @@ -72,9 +72,6 @@ class InboundEstablishState { _alicePort = remotePort; _remoteHostId = new RemoteHostId(_aliceIP, _alicePort); _bobPort = localPort; - _keyBuilder = null; - _verificationAttempted = false; - _complete = false; _currentState = STATE_UNKNOWN; _establishBegin = ctx.clock().now(); } diff --git a/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java b/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java index 1e23a210c5..76753a5f58 100644 --- a/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java +++ b/router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java @@ -86,13 +86,11 @@ class OutboundEstablishState { } _remotePeer = remotePeer; _introKey = introKey; - _keyBuilder = null; _queuedMessages = new LinkedBlockingQueue(); _currentState = STATE_UNKNOWN; _establishBegin = ctx.clock().now(); _remoteAddress = addr; _introductionNonce = -1; - _complete = false; prepareSessionRequest(); if ( (addr != null) && (addr.getIntroducerCount() > 0) ) { if (_log.shouldLog(Log.DEBUG)) diff --git a/router/java/src/net/i2p/router/transport/udp/OutboundMessageFragments.java b/router/java/src/net/i2p/router/transport/udp/OutboundMessageFragments.java index e25ab03691..58e700f098 100644 --- a/router/java/src/net/i2p/router/transport/udp/OutboundMessageFragments.java +++ b/router/java/src/net/i2p/router/transport/udp/OutboundMessageFragments.java @@ -47,7 +47,6 @@ class OutboundMessageFragments { _transport = transport; // _throttle = throttle; _activePeers = new ArrayList(256); - _nextPeer = 0; _builder = new PacketBuilder(ctx, transport); _alive = true; // _allowExcess = false; diff --git a/router/java/src/net/i2p/router/transport/udp/OutboundMessageState.java b/router/java/src/net/i2p/router/transport/udp/OutboundMessageState.java index a545cfb062..0e5ed7ef36 100644 --- a/router/java/src/net/i2p/router/transport/udp/OutboundMessageState.java +++ b/router/java/src/net/i2p/router/transport/udp/OutboundMessageState.java @@ -47,9 +47,6 @@ class OutboundMessageState { public OutboundMessageState(I2PAppContext context) { _context = context; _log = _context.logManager().getLog(OutboundMessageState.class); - _pushCount = 0; - _maxSends = 0; - // _nextSendFragment = 0; } public boolean initialize(OutNetMessage msg) { diff --git a/router/java/src/net/i2p/router/transport/udp/PeerState.java b/router/java/src/net/i2p/router/transport/udp/PeerState.java index 2c518ed697..54ece24c27 100644 --- a/router/java/src/net/i2p/router/transport/udp/PeerState.java +++ b/router/java/src/net/i2p/router/transport/udp/PeerState.java @@ -246,36 +246,19 @@ class PeerState { _context = ctx; _log = ctx.logManager().getLog(PeerState.class); _transport = transport; - _remotePeer = null; - _currentMACKey = null; - _currentCipherKey = null; - _nextMACKey = null; - _nextCipherKey = null; - _nextKeyingMaterial = null; - _rekeyBeganLocally = false; _keyEstablishedTime = -1; - _clockSkew = 0; _currentReceiveSecond = -1; _lastSendTime = -1; _lastReceiveTime = -1; _currentACKs = new ConcurrentHashSet(); _currentACKsResend = new LinkedBlockingQueue(); - _currentSecondECNReceived = false; - _remoteWantsPreviousACKs = false; _sendWindowBytes = DEFAULT_SEND_WINDOW_BYTES; _sendWindowBytesRemaining = DEFAULT_SEND_WINDOW_BYTES; _slowStartThreshold = MAX_SEND_WINDOW_BYTES/2; _lastSendRefill = _context.clock().now(); _receivePeriodBegin = _lastSendRefill; - _sendBps = 0; - _sendBytes = 0; - _receiveBps = 0; _lastCongestionOccurred = -1; - _remoteIP = null; _remotePort = -1; - _remoteRequiresIntroduction = false; - _weRelayToThemAs = 0; - _theyRelayToUsAs = 0; _mtu = getDefaultMTU(); _mtuReceive = _mtu; _mtuLastChecked = -1; @@ -283,19 +266,8 @@ class PeerState { _rto = MIN_RTO; _rtt = _rto/2; _rttDeviation = _rtt; - _messagesReceived = 0; - _messagesSent = 0; - _packetsTransmitted = 0; - _packetsRetransmitted = 0; - _packetRetransmissionRate = 0; - _retransmissionPeriodStart = 0; - _packetsReceived = 0; - _packetsReceivedDuplicate = 0; _inboundMessages = new HashMap(8); _outboundMessages = new ArrayList(32); - _dead = false; - _isInbound = false; - _lastIntroducerTime = 0; _context.statManager().createRateStat("udp.congestionOccurred", "How large the cwin was when congestion occurred (duration == sendBps)", "udp", UDPTransport.RATES); _context.statManager().createRateStat("udp.congestedRTO", "retransmission timeout after congestion (duration == rtt dev)", "udp", UDPTransport.RATES); _context.statManager().createRateStat("udp.sendACKPartial", "Number of partial ACKs sent (duration == number of full ACKs in that ack packet)", "udp", UDPTransport.RATES); diff --git a/router/java/src/net/i2p/router/transport/udp/PeerTestManager.java b/router/java/src/net/i2p/router/transport/udp/PeerTestManager.java index aa145bbe96..a3211a5a62 100644 --- a/router/java/src/net/i2p/router/transport/udp/PeerTestManager.java +++ b/router/java/src/net/i2p/router/transport/udp/PeerTestManager.java @@ -118,8 +118,6 @@ class PeerTestManager { _activeTests = new ConcurrentHashMap(); _recentTests = new LinkedBlockingQueue(); _packetBuilder = new PacketBuilder(context, transport); - _currentTest = null; - _currentTestComplete = false; _context.statManager().createRateStat("udp.statusKnownCharlie", "How often the bob we pick passes us to a charlie we already have a session with?", "udp", UDPTransport.RATES); _context.statManager().createRateStat("udp.receiveTestReply", "How often we get a reply to our peer test?", "udp", UDPTransport.RATES); _context.statManager().createRateStat("udp.receiveTest", "How often we get a packet requesting us to participate in a peer test?", "udp", UDPTransport.RATES); diff --git a/router/java/src/net/i2p/router/transport/udp/TimedWeightedPriorityMessageQueue.java b/router/java/src/net/i2p/router/transport/udp/TimedWeightedPriorityMessageQueue.java index 9721f22cce..86fe2c8113 100644 --- a/router/java/src/net/i2p/router/transport/udp/TimedWeightedPriorityMessageQueue.java +++ b/router/java/src/net/i2p/router/transport/udp/TimedWeightedPriorityMessageQueue.java @@ -76,7 +76,6 @@ class TimedWeightedPriorityMessageQueue implements MessageQueue, OutboundMessage } _alive = true; _nextLock = this; - _nextQueue = 0; _chokedPeers = Collections.synchronizedSet(new HashSet(16)); _listener = lsnr; _context.statManager().createRateStat("udp.timeToEntrance", "Message lifetime until it reaches the UDP system", "udp", UDPTransport.RATES); diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index dc0790ac48..e287d14266 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -177,7 +177,6 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority _peersByIdent = new ConcurrentHashMap(128); _peersByRemoteHost = new ConcurrentHashMap(128); _dropList = new ConcurrentHashSet(2); - _endpoint = null; // See comments in DQAT.java if (USE_PRIORITY) { -- GitLab