Changeset 5ca2f306


Ignore:
Timestamp:
Aug 30, 2009 4:05:33 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d868f7c0
Parents:
c714c1a
Message:

consume sessiontag after failed tunnel test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/pool/TestJob.java

    rc714c1a r5ca2f306  
    2929    private TunnelInfo _replyTunnel;
    3030    private PooledTunnelCreatorConfig _otherTunnel;
     31    /** save this so we can tell the SKM to kill it if the test fails */
     32    private SessionTag _encryptTag;
    3133   
    3234    /** base to randomize the test delay on */
     
    126128
    127129        SessionKey encryptKey = getContext().keyGenerator().generateSessionKey();
    128         SessionTag encryptTag = new SessionTag(true);
     130        _encryptTag = new SessionTag(true);
    129131        SessionKey sentKey = new SessionKey();
    130132        Set sentTags = null;
    131133        GarlicMessage msg = GarlicMessageBuilder.buildMessage(getContext(), payload, sentKey, sentTags,
    132134                                                              getContext().keyManager().getPublicKey(),
    133                                                               encryptKey, encryptTag);
     135                                                              encryptKey, _encryptTag);
    134136
    135137        if (msg == null) {
     
    139141        }
    140142        Set encryptTags = new HashSet(1);
    141         encryptTags.add(encryptTag);
     143        encryptTags.add(_encryptTag);
     144        // Register the single tag with the SKM
    142145        getContext().sessionKeyManager().tagsReceived(encryptKey, encryptTags);
    143146
     
    305308            if (_log.shouldLog(Log.WARN))
    306309                _log.warn("Timeout: found? " + _found, getAddedBy());
    307             if (!_found)
     310            if (!_found) {
     311                // don't clog up the SKM with old one-tag tagsets
     312                getContext().sessionKeyManager().consumeTag(_encryptTag);
    308313                testFailed(getContext().clock().now() - _started);
     314            }
    309315        }
    310316       
Note: See TracChangeset for help on using the changeset viewer.