Changeset ec061eb


Ignore:
Timestamp:
Jul 24, 2011 12:38:50 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
89d32e3
Parents:
702da0a
Message:

more final and cleanups

Location:
router/java/src/net/i2p/router/transport/udp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/transport/udp/IntroductionManager.java

    r702da0a rec061eb  
    2222 */
    2323class IntroductionManager {
    24     private RouterContext _context;
    25     private Log _log;
    26     private UDPTransport _transport;
    27     private PacketBuilder _builder;
     24    private final RouterContext _context;
     25    private final Log _log;
     26    private final UDPTransport _transport;
     27    private final PacketBuilder _builder;
    2828    /** map of relay tag to PeerState that should receive the introduction */
    2929    private final Map<Long, PeerState> _outbound;
  • router/java/src/net/i2p/router/transport/udp/MessageReceiver.java

    r702da0a rec061eb  
    2121 */
    2222class MessageReceiver {
    23     private RouterContext _context;
    24     private Log _log;
    25     private UDPTransport _transport;
     23    private final RouterContext _context;
     24    private final Log _log;
     25    private final UDPTransport _transport;
    2626    /** list of messages (InboundMessageState) fully received but not interpreted yet */
    2727    private final BlockingQueue<InboundMessageState> _completeMessages;
  • router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java

    r702da0a rec061eb  
    5151    private RemoteHostId _remoteHostId;
    5252    private final RouterIdentity _remotePeer;
    53     private SessionKey _introKey;
     53    private final SessionKey _introKey;
    5454    private final Queue<OutNetMessage> _queuedMessages;
    5555    private int _currentState;
  • router/java/src/net/i2p/router/transport/udp/PacketBuilder.java

    r702da0a rec061eb  
    9696 */
    9797class PacketBuilder {
    98     private I2PAppContext _context;
    99     private Log _log;
    100     private UDPTransport _transport;
     98    private final I2PAppContext _context;
     99    private final Log _log;
     100    private final UDPTransport _transport;
    101101   
    102102    private static final ByteCache _ivCache = ByteCache.getInstance(64, UDPPacket.IV_SIZE);
  • router/java/src/net/i2p/router/transport/udp/PeerTestManager.java

    r702da0a rec061eb  
    9292 */
    9393class PeerTestManager {
    94     private RouterContext _context;
    95     private Log _log;
    96     private UDPTransport _transport;
    97     private PacketBuilder _packetBuilder;
     94    private final RouterContext _context;
     95    private final Log _log;
     96    private final UDPTransport _transport;
     97    private final PacketBuilder _packetBuilder;
    9898    /** map of Long(nonce) to PeerTestState for tests currently in progress (as Bob/Charlie) */
    9999    private final Map<Long, PeerTestState> _activeTests;
     
    102102    private boolean _currentTestComplete;
    103103    /** as Alice */
    104     private Queue<Long> _recentTests;
     104    private final Queue<Long> _recentTests;
    105105   
    106106    /** longest we will keep track of a Charlie nonce for */
  • router/java/src/net/i2p/router/transport/udp/UDPPacket.java

    r702da0a rec061eb  
    2020    private I2PAppContext _context;
    2121    private static Log _log;
    22     private volatile DatagramPacket _packet;
     22    private final DatagramPacket _packet;
    2323    private volatile short _priority;
    2424    private volatile long _initializeTime;
    2525    private volatile long _expiration;
    26     private byte[] _data;
    27     private byte[] _validateBuf;
    28     private byte[] _ivBuf;
     26    private final byte[] _data;
     27    private final byte[] _validateBuf;
     28    private final byte[] _ivBuf;
    2929    private volatile int _markedType;
    3030    private volatile RemoteHostId _remoteHost;
     
    8282    private static final int MAX_VALIDATE_SIZE = MAX_PACKET_SIZE;
    8383
    84     private UDPPacket(I2PAppContext ctx, boolean inbound) {
     84    private UDPPacket(I2PAppContext ctx) {
    8585        ctx.statManager().createRateStat("udp.fetchRemoteSlow", "How long it takes to grab the remote ip info", "udp", UDPTransport.RATES);
    8686        // the data buffer is clobbered on init(..), but we need it to bootstrap
     
    8989        _validateBuf = new byte[MAX_VALIDATE_SIZE];
    9090        _ivBuf = new byte[IV_SIZE];
    91         init(ctx, inbound);
    92     }
    93     // FIXME optimization, remove the inbound parameter, as it is unused. FIXME
    94     private void init(I2PAppContext ctx, boolean inbound) {
     91        init(ctx);
     92    }
     93
     94    private void init(I2PAppContext ctx) {
    9595        _context = ctx;
    9696        //_dataBuf = _dataCache.acquire();
    9797        Arrays.fill(_data, (byte)0);
    9898        //_packet = new DatagramPacket(_data, MAX_PACKET_SIZE);
    99         _packet.setData(_data);
     99        //_packet.setData(_data);
    100100        // _isInbound = inbound;
    101101        _initializeTime = _context.clock().now();
     
    263263    }
    264264   
     265    /**
     266     *  @param inbound unused
     267     */
    265268    public static UDPPacket acquire(I2PAppContext ctx, boolean inbound) {
    266269        UDPPacket rv = null;
     
    268271            rv = _packetCache.poll();
    269272            if (rv != null)
    270                 rv.init(ctx, inbound);
     273                rv.init(ctx);
    271274        }
    272275        if (rv == null)
    273             rv = new UDPPacket(ctx, inbound);
     276            rv = new UDPPacket(ctx);
    274277        //if (rv._acquiredBy != null) {
    275278        //    _log.log(Log.CRIT, "Already acquired!  current stack trace is:", new Exception());
  • router/java/src/net/i2p/router/transport/udp/UDPPacketReader.java

    r702da0a rec061eb  
    1717 */
    1818class UDPPacketReader {
    19     private I2PAppContext _context;
    20     private Log _log;
     19    private final I2PAppContext _context;
     20    private final Log _log;
    2121    private byte _message[];
    2222    private int _payloadBeginOffset;
    2323    private int _payloadLength;
    24     private SessionRequestReader _sessionRequestReader;
    25     private SessionCreatedReader _sessionCreatedReader;
    26     private SessionConfirmedReader _sessionConfirmedReader;
    27     private DataReader _dataReader;
    28     private PeerTestReader _peerTestReader;
    29     private RelayRequestReader _relayRequestReader;
    30     private RelayIntroReader _relayIntroReader;
    31     private RelayResponseReader _relayResponseReader;
     24    private final SessionRequestReader _sessionRequestReader;
     25    private final SessionCreatedReader _sessionCreatedReader;
     26    private final SessionConfirmedReader _sessionConfirmedReader;
     27    private final DataReader _dataReader;
     28    private final PeerTestReader _peerTestReader;
     29    private final RelayRequestReader _relayRequestReader;
     30    private final RelayIntroReader _relayIntroReader;
     31    private final RelayResponseReader _relayResponseReader;
    3232   
    3333    private static final int KEYING_MATERIAL_LENGTH = 64;
Note: See TracChangeset for help on using the changeset viewer.