Changeset 319d4014 for router


Ignore:
Timestamp:
Mar 14, 2016 3:13:26 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
387dc98
Parents:
2e3f5d0d
Message:

Router: Fix corner cases maintaining local leasesets (ticket #1768)

Location:
router/java/src/net/i2p/router
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/RouterVersion.java

    r2e3f5d0d r319d4014  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 11;
     21    public final static long BUILD = 12;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/client/ClientConnectionRunner.java

    r2e3f5d0d r319d4014  
    293293     *  IS subsession aware.
    294294     */
     295/****
    295296    void setLeaseSet(LeaseSet ls) {
    296297        Hash h = ls.getDestination().calculateHash();
     
    300301        sp.currentLeaseSet = ls;
    301302    }
     303****/
    302304
    303305    /**
     
    591593        LeaseRequestState state;
    592594        synchronized (this) {
     595            sp.currentLeaseSet = ls;
    593596            state = sp.leaseRequest;
    594597            if (state == null) {
     598                // We got the LS after the timeout?
     599                // ClientMessageEventListener told the router to publish.
    595600                if (_log.shouldLog(Log.WARN))
    596                     _log.warn("LeaseRequest is null and we've received a new lease?! perhaps this is odd... " + ls);
     601                    _log.warn("LeaseRequest is null and we've received a new lease? " + ls);
    597602                return;
    598603            } else {
    599604                state.setIsSuccessful(true);
    600                 setLeaseSet(ls);
    601605                if (_log.shouldLog(Log.DEBUG))
    602606                    _log.debug("LeaseSet created fully: " + state + " / " + ls);
     
    10721076                inLock = _context.clock().now();
    10731077                if (_alreadyProcessed.contains(_messageId)) {
    1074                     _log.warn("Status already updated");
     1078                    _log.info("Status already updated");
    10751079                    alreadyProcessed = true;
    10761080                } else {
  • router/java/src/net/i2p/router/client/ClientManager.java

    r2e3f5d0d r319d4014  
    1414import java.util.Collections;
    1515import java.util.HashSet;
     16import java.util.Iterator;
    1617import java.util.List;
    1718import java.util.Map;
     
    236237                _runners.remove(dest);
    237238                _runnersByHash.remove(dest.calculateHash());
     239            }
     240            // just in case
     241            for (Iterator<ClientConnectionRunner> iter = _runners.values().iterator(); iter.hasNext(); ) {
     242                ClientConnectionRunner r = iter.next();
     243                if (r.equals(runner))
     244                    iter.remove();
     245            }
     246            for (Iterator<ClientConnectionRunner> iter = _runnersByHash.values().iterator(); iter.hasNext(); ) {
     247                ClientConnectionRunner r = iter.next();
     248                if (r.equals(runner))
     249                    iter.remove();
    238250            }
    239251        }
  • router/java/src/net/i2p/router/client/RequestLeaseSetJob.java

    r2e3f5d0d r319d4014  
    6666
    6767        SessionId id = _runner.getSessionId(requested.getDestination().calculateHash());
    68         if (id == null)
     68        if (id == null) {
     69            _runner.failLeaseRequest(_requestState);
    6970            return;
     71        }
    7072        I2CPMessage msg;
    7173        if (getContext().getProperty(PROP_VARIABLE, DFLT_VARIABLE) &&
Note: See TracChangeset for help on using the changeset viewer.