Changeset 3331e1c


Ignore:
Timestamp:
Sep 22, 2014 6:49:20 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
012cc74, be0cb84
Parents:
591f488
Message:

SSU: Return unused DH to the queue

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

Legend:

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

    r591f488 r3331e1c  
    13641364            _transport.dropPeer(peer, false, err);
    13651365            //_context.profileManager().commErrorOccurred(peer);
     1366            outboundState.fail();
    13661367        } else {
    13671368            OutNetMessage msg;
  • router/java/src/net/i2p/router/transport/udp/OutboundEstablishState.java

    r591f488 r3331e1c  
    202202    private void prepareSessionRequest() {
    203203        _keyBuilder = _keyFactory.getBuilder();
    204         _sentX = new byte[UDPPacketReader.SessionRequestReader.X_LENGTH];
    205204        byte X[] = _keyBuilder.getMyPublicValue().toByteArray();
    206         if (X.length == 257)
     205        if (X.length == 257) {
     206            _sentX = new byte[256];
    207207            System.arraycopy(X, 1, _sentX, 0, _sentX.length);
    208         else if (X.length == 256)
    209             System.arraycopy(X, 0, _sentX, 0, _sentX.length);
    210         else
     208        } else if (X.length == 256) {
     209            _sentX = X;
     210        } else {
     211            _sentX = new byte[256];
    211212            System.arraycopy(X, 0, _sentX, _sentX.length - X.length, X.length);
     213        }
    212214    }
    213215
     
    220222    }
    221223
    222     /**
     224    /**x
    223225     * The remote side (Bob) - note that in some places he's called Charlie.
    224226     * Warning - may change after introduction. May be null before introduction.
     
    340342        _receivedIV = null;
    341343        _receivedSignature = null;
     344        if (_keyBuilder != null) {
     345            if (_keyBuilder.getPeerPublicValue() == null)
     346                _keyFactory.returnUnused(_keyBuilder);
     347            _keyBuilder = null;
     348        }
    342349        // sure, there's a chance the packet was corrupted, but in practice
    343350        // this means that Bob doesn't know his external port, so give up.
Note: See TracChangeset for help on using the changeset viewer.