Changeset 2590e7d


Ignore:
Timestamp:
Jun 4, 2015 10:25:44 PM (5 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
09cdc00
Parents:
27f5677
Message:

i2ptunnel: Don't connect manager to router in constructor (ticket #815)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelClientBase.java

    r27f5677 r2590e7d  
    120120    /**
    121121     * The main constructor.
    122      *
    123      * As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     122     * <p/>
     123     * As of 0.9.21 this is fast, and does NOT connect the manager to the router,
    124124     * or open the local socket. You MUST call startRunning() for that.
     125     * <p/>
     126     * (0.9.20 claimed to be fast, but due to a bug it DID connect the manager
     127     * to the router. It did NOT open the local socket however, so it was still
     128     * necessary to call startRunning() for that.)
    125129     *
    126130     * @param localPort if 0, use any port, get actual port selected with getLocalPort()
     
    136140    /**
    137141     * Use this to build a client with a persistent private key.
    138      *
    139      * As of 0.9.20 this is fast, and does NOT connect the manager to the router,
     142     * <p/>
     143     * As of 0.9.21 this is fast, and does NOT connect the manager to the router,
    140144     * or open the local socket. You MUST call startRunning() for that.
     145     * <p/>
     146     * (0.9.20 claimed to be fast, but due to a bug it DID connect the manager
     147     * to the router. It did NOT open the local socket however, so it was still
     148     * necessary to call startRunning() for that.)
    141149     *
    142150     * @param localPort if 0, use any port, get actual port selected with getLocalPort()
     
    179187        if (tunnel.getClientOptions().getProperty("i2p.streaming.answerPings") == null)
    180188            tunnel.getClientOptions().setProperty("i2p.streaming.answerPings", "false");
    181        
    182         boolean openNow = !Boolean.parseBoolean(tunnel.getClientOptions().getProperty("i2cp.delayOpen"));
    183         if (openNow) {
    184             while (sockMgr == null) {
    185                 verifySocketManager();
    186                 if (sockMgr == null) {
    187                     _log.error("Unable to connect to router and build tunnels for " + handlerName);
    188                     // FIXME there is a loop in buildSocketManager(), do we really need another one here?
    189                     // no matter, buildSocketManager() now throws an IllegalArgumentException
    190                     try { Thread.sleep(10*1000); } catch (InterruptedException ie) {}
    191                 }
    192             }
    193             // can't be null unless we limit the loop above
    194             //if (sockMgr == null) {
    195             //    l.log("Invalid I2CP configuration");
    196             //    throw new IllegalArgumentException("Socket manager could not be created");
    197             //}
    198             l.log("Tunnels ready for client: " + handlerName);
    199 
    200         } // else delay creating session until createI2PSocket() is called
    201        
    202189    }
    203190   
  • history.txt

    r27f5677 r2590e7d  
     12015-06-04 str4d
     2 * i2ptunnel:
     3   - Don't connect manager to router in constructor (ticket #815)
     4
    152015-06-03 zzz
    26Prop from i2p.i2p.zzz.sam:
Note: See TracChangeset for help on using the changeset viewer.