Changeset 9030b64


Ignore:
Timestamp:
Mar 2, 2011 6:24:18 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b2d4a79
Parents:
cacd0f8 (diff), cb70778 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of 'ae690eef1560c4b0cbabfd7f75a663bac6b6ee99'

and 'd88d323de60e5ba66e1c96e2d11f91de9029b27d'

Files:
7 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java

    rcacd0f8 r9030b64  
    135135   
    136136    /**
    137      *  @param KBps
     137     *  @param limit KBps
    138138     */
    139139    public void setMaxUpBW(int limit) {
  • apps/i2psnark/java/src/org/klomp/snark/MagnetState.java

    rcacd0f8 r9030b64  
    5858
    5959    /**
    60      *  @param call this for a new magnet when you have the size
     60     *  Call this for a new magnet when you have the size
    6161     *  @throws IllegalArgumentException
    6262     */
     
    7878
    7979    /**
    80      *  @param Call this for a new magnet when the download is complete.
     80     *  Call this for a new magnet when the download is complete.
    8181     *  @throws IllegalArgumentException
    8282     */
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    rcacd0f8 r9030b64  
    645645     * @param ih 20 byte info hash
    646646     * @param trackerURL may be null
    647      * @param udpateStatus should we add this magnet to the config file,
     647     * @param updateStatus should we add this magnet to the config file,
    648648     *                     to save it across restarts, in case we don't get
    649649     *                     the metadata before shutdown?
  • apps/i2psnark/java/src/org/klomp/snark/dht/DHT.java

    rcacd0f8 r9030b64  
    5555     *
    5656     *  @param ih the Info Hash (torrent)
    57      *  @param peer the peer's Hash
     57     *  @param peerHash the peer's Hash
    5858     */
    5959    public void announce(byte[] ih, byte[] peerHash);
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    rcacd0f8 r9030b64  
    354354                                            ua.startsWith("ELinks") || ua.startsWith("Dillo"));
    355355
    356         boolean noThinsp = isDegraded || ua.startsWith("Opera");
     356        boolean noThinsp = isDegraded || (ua != null && ua.startsWith("Opera"));
    357357        if (_manager.util().connected()) {
    358358            if (isDegraded)
     
    18841884        if (mime.equals("text/html"))
    18851885            icon = "html";
    1886         else if (mime.equals("text/plain") || plc.endsWith(".nfo"))
     1886        else if (mime.equals("text/plain") || plc.endsWith(".nfo") ||
     1887                 mime.equals("application/rtf"))
    18871888            icon = "page";
    18881889        else if (mime.equals("application/java-archive") || plc.endsWith(".war") ||
  • apps/routerconsole/java/build.xml

    rcacd0f8 r9030b64  
    6464    </target>
    6565
    66     <target name="jar" depends="compile, jarUpToDate" unless="jar.uptodate" >
     66    <!-- the jar with the latest message classes from the jsps, and the war too -->
     67    <target name="jar" depends="jar1, war, bundle" />
     68
     69    <!-- the jar without the latest message classes from the jsps -->
     70    <target name="jar1" depends="compile, jarUpToDate" unless="jar.uptodate" >
    6771        <exec executable="mtn" outputproperty="workspace.changes.j" errorproperty="mtn.error2" failifexecutionfails="false" >
    6872            <arg value="list" />
    6973            <arg value="changed" />
    7074            <arg value="." />
     75            <arg value="../locale" />
    7176        </exec>
    7277        <!-- \n in an attribute value generates an invalid manifest -->
     
    8691            </manifest>
    8792        </jar>
     93       <!-- jrobin taken out of routerconsole.jar in 0.7.12
    8894        <delete dir="./tmpextract" />
    89        <!-- jrobin taken out of routerconsole.jar in 0.7.12
    9095        <unjar src="../../jrobin/jrobin-1.4.0.jar" dest="./tmpextract" />
    9196        <jar destfile="./build/routerconsole.jar" basedir="./tmpextract" update="true" />
    9297        <delete dir="./tmpextract" />
    9398       -->
    94        
    95         <ant target="war" />
    96 
     99    </target>
     100
     101    <!-- this is tricky because the message classes go in the jar, not in the war -->
     102    <target name="bundle" depends="jar1, precompilejsp" >
    97103        <!-- Update the messages_*.po files.
    98104             We need to supply the bat file for windows, and then change the fail property to true -->
     
    118124    </target>
    119125
    120     <target name="poupdate" depends="build">
    121         <ant target="war" />
     126    <target name="poupdate" depends="precompilejsp">
    122127        <!-- Update the messages_*.po files.
    123128             We need to supply the bat file for windows, and then change the fail property to true -->
     
    136141    </target>
    137142
     143    <!-- does NOT update the message classes, as those go in the jar -->
    138144    <target name="war" depends="precompilejsp, warUpToDate" unless="war.uptodate" >
    139145        <exec executable="mtn" outputproperty="workspace.changes.w" errorproperty="mtn.error2" failifexecutionfails="false" >
     
    165171    </target>
    166172
    167     <target name="precompilejsp" unless="precompilejsp.uptodate">
     173    <target name="precompilejsp" depends="jar1" unless="precompilejsp.uptodate">
    168174        <delete dir="../jsp/WEB-INF/" />
    169175        <delete file="../jsp/web-fragment.xml" />
     
    266272
    267273    <uptodate property="precompilejsp.uptodate" targetfile="../jsp/web-out.xml">
    268         <srcfiles dir= "../jsp" includes="**/*.jsp, **/*.html, *.css, susimail/susimail, web.xml"/>
     274        <srcfiles dir= "../jsp" includes="**/*.jsp, *.jsi, **/*.html, *.css, susimail/susimail, web.xml"/>
    269275    </uptodate>
    270276
  • core/java/src/net/i2p/CoreVersion.java

    rcacd0f8 r9030b64  
    1717    /** deprecated */
    1818    public final static String ID = "Monotone";
    19     public final static String VERSION = "0.8.3";
     19    public final static String VERSION = "0.8.4";
    2020
    2121    public static void main(String args[]) {
  • core/java/src/net/i2p/stat/StatManager.java

    rcacd0f8 r9030b64  
    5555        "prng.bufferFillTime,prng.bufferWaitTime,router.memoryUsed," +
    5656        "transport.receiveMessageSize,transport.sendMessageSize,transport.sendProcessingTime," +
    57         "tunnel.acceptLoad,tunnel.buildRequestTime,tunnel.rejectOverloaded,tunnel.rejectTimeout" +
     57        "tunnel.acceptLoad,tunnel.buildRequestTime,tunnel.rejectOverloaded,tunnel.rejectTimeout," +
    5858        "tunnel.buildClientExpire,tunnel.buildClientReject,tunnel.buildClientSuccess," +
    5959        "tunnel.buildExploratoryExpire,tunnel.buildExploratoryReject,tunnel.buildExploratorySuccess," +
  • history.txt

    rcacd0f8 r9030b64  
     12011-03-02 zzz
     2    * BuildHandler:
     3      - Limit request queue size
     4      - Concurrent request queue
     5      - Remove dead code for queued rely handling
     6    * OutNetMessage: Remove dead code
     7    * Tunnel cleanups, final, javadoc
     8
     9* 2011-03-02  0.8.4 released
     10
    1112011-02-27 zzz
    212    * Console:
  • installer/install.xml

    rcacd0f8 r9030b64  
    55    <info>
    66        <appname>i2p</appname>
    7         <appversion>0.8.3</appversion>
     7        <appversion>0.8.4</appversion>
    88        <authors>
    99            <author name="I2P" email="http://forum.i2p2.de/"/>
  • installer/resources/news.xml

    rcacd0f8 r9030b64  
    11<!--
    2 <i2p.news date="$Date: 2011-01-24 00:00:00 $">
    3 <i2p.release version="0.8.3" date="2011/01/24" minVersion="0.6" />
     2<i2p.news date="$Date: 2011-03-02 00:00:00 $">
     3<i2p.release version="0.8.4" date="2011/03/02" minVersion="0.6" />
    44-->
    55<div lang="en">
    6 <h3>2011-01-24: <b>0.8.3 <a href="http://www.i2p2.i2p/release-0.8.3.html">Released</a></b></h3>
     6<h3>2011-03-02: <b>0.8.4 <a href="http://www.i2p2.i2p/release-0.8.4.html">Released</a></b></h3>
    77<p>
    8 The 0.8.3 release contains several performance improvements, including reduction of threads and
    9 memory usage, and faster I2CP (client-router) communication.
    10 </p><p>
    11 There is also new SSL router console support
    12 (<a href="http://zzz.i2p/topics/800">instructions here</a>),
    13 a new <a href="/configreseed">reseed configuration page</a> including HTTP proxy support for those behind restrictive firewalls,
    14 a new <a href="/configclients#i2cp">I2CP configuration section</a> including I2CP-over-SSL support for remote clients,
    15 a new <a href="/i2ptunnel/edit?tunnel=3">server connection limits and blacklist configuration section</a> for enhanced DoS protection,
    16 and a new
    17 <a href="/i2ptunnel/edit?tunnel=0">HTTP proxy jump server configuration section</a> so you may easily add alternative jump servers.
    18 Statistics are now limited by default to reduce memory usage; the full set of statistics may be re-enabled on the
    19 <a href="/configstats">stats configuration page</a>.
    20 There are also bug fixes, of course, so
    21 as usual, upgrading is recommended.
     8The 0.8.4 release contains some performance improvements and important bug fixes.
     9Also, i2psnark now supports magnet links.
     10As usual, upgrading is recommended.
    2211</p><p>
    2312Please help grow the network.
     
    2817If you find a bug, please enter a report on <a href="http://trac.i2p2.i2p/report/1">trac</a>.
    2918We are still looking for volunteers to work on new and existing translations.
    30 Please volunteer on <a href="irc://127.0.0.1:6668/i2p">IRC #i2p</a>.
     19Please volunteer on <a href="irc://127.0.0.1:6668/i2p">IRC #i2p-dev</a>.
    3120</p>
    3221</div>
  • router/java/src/net/i2p/router/InNetMessagePool.java

    rcacd0f8 r9030b64  
    8282        }
    8383        _log = _context.logManager().getLog(InNetMessagePool.class);
    84         _alive = false;
    8584        _context.statManager().createRateStat("inNetPool.dropped", "How often do we drop a message", "InNetPool", new long[] { 60*60*1000l });
    8685        _context.statManager().createRateStat("inNetPool.droppedDeliveryStatusDelay", "How long after a delivery status message is created do we receive it back again (for messages that are too slow to be handled)", "InNetPool", new long[] { 60*60*1000l });
     
    9089    }
    9190 
     91    /**
     92     * @return previous builder for this message type, or null
     93     * @throws AIOOBE if i2npMessageType is greater than MAX_I2NP_MESSAGE_TYPE
     94     */
    9295    public HandlerJobBuilder registerHandlerJobBuilder(int i2npMessageType, HandlerJobBuilder builder) {
    9396        HandlerJobBuilder old = _handlerJobBuilders[i2npMessageType];
     
    9699    }
    97100 
     101    /**
     102     * @return previous builder for this message type, or null
     103     * @throws AIOOBE if i2npMessageType is greater than MAX_I2NP_MESSAGE_TYPE
     104     */
    98105    public HandlerJobBuilder unregisterHandlerJobBuilder(int i2npMessageType) {
    99106        HandlerJobBuilder old = _handlerJobBuilders[i2npMessageType];
     
    103110   
    104111    /**
    105      * Add a new message to the pool, returning the number of messages in the
    106      * pool so that the comm system can throttle inbound messages.  If there is
     112     * Add a new message to the pool.
     113     * If there is
    107114     * a HandlerJobBuilder for the inbound message type, the message is loaded
    108115     * into a job created by that builder and queued up for processing instead
    109116     * (though if the builder doesn't create a job, it is added to the pool)
    110117     *
     118     * @return -1 for some types of errors but not all; 0 otherwise
     119     *         (was queue length, long ago)
    111120     */
    112121    public int add(I2NPMessage messageBody, RouterIdentity fromRouter, Hash fromRouterHash) {
  • router/java/src/net/i2p/router/OutNetMessage.java

    rcacd0f8 r9030b64  
    3030 */
    3131public class OutNetMessage {
    32     private Log _log;
    33     private RouterContext _context;
     32    private final Log _log;
     33    private final RouterContext _context;
    3434    private RouterInfo _target;
    3535    private I2NPMessage _message;
     
    5151    private long _transmitBegin;
    5252    private Exception _createdBy;
    53     private long _created;
     53    private final long _created;
    5454    /** for debugging, contains a mapping of even name to Long (e.g. "begin sending", "handleOutbound", etc) */
    5555    private HashMap<String, Long> _timestamps;
  • router/java/src/net/i2p/router/OutNetMessagePool.java

    rcacd0f8 r9030b64  
    1919 * retrieves messages for delivery.
    2020 *
     21 * Actually, this doesn't 'pool' anything, it calls the comm system directly.
     22 * Nor does it organize by priority. But perhaps it could someday.
    2123 */
    2224public class OutNetMessagePool {
    23     private Log _log;
    24     private RouterContext _context;
     25    private final Log _log;
     26    private final RouterContext _context;
    2527   
    2628    public OutNetMessagePool(RouterContext context) {
    2729        _context = context;
    2830        _log = _context.logManager().getLog(OutNetMessagePool.class);
    29     }
    30    
    31     /**
    32      * Remove the highest priority message, or null if none are available.
    33      *
    34      */
    35     public OutNetMessage getNext() {
    36         return null;
    3731    }
    3832   
     
    4842        }       
    4943       
    50         if (_log.shouldLog(Log.INFO))
    51                 _log.info("Adding outbound message to "
     44        if (_log.shouldLog(Log.DEBUG))
     45                _log.debug("Adding outbound message to "
    5246                          + msg.getTarget().getIdentity().getHash().toBase64().substring(0,6)
    5347                          + " with id " + msg.getMessage().getUniqueId()
     
    7165        }
    7266        if (msg.getTarget() == null) {
    73             _log.error("No target in the OutNetMessage: " + msg, new Exception("Definitely a fuckup"));
     67            _log.error("No target in the OutNetMessage: " + msg, new Exception());
    7468            return false;
    7569        }
     
    8478        return true;
    8579    }
    86    
    87     /**
    88      * Clear any messages that have expired, enqueuing any appropriate jobs
    89      *
    90      */
    91     public void clearExpired() {
    92         // noop
    93     }
    94    
    95     /**
    96      * Retrieve the number of messages, regardless of priority.
    97      *
    98      */
    99     public int getCount() {  return 0; }
    100    
    101     /**
    102      * Retrieve the number of messages at the given priority.  This can be used for
    103      * subsystems that maintain a pool of messages to be sent whenever there is spare time,
    104      * where all of these 'spare' messages are of the same priority.
    105      *
    106      */
    107     public int getCount(int priority) { return 0; }
    108    
    109     public void dumpPoolInfo() { return; }
    110    
    111     private static class ReverseIntegerComparator implements Comparator {
    112         public int compare(Object lhs, Object rhs) {
    113             if ( (lhs == null) || (rhs == null) ) return 0; // invalid, but never used
    114             if ( !(lhs instanceof Integer) || !(rhs instanceof Integer)) return 0;
    115             Integer lv = (Integer)lhs;
    116             Integer rv = (Integer)rhs;
    117             return - (lv.compareTo(rv));
    118         }
    119     }
    12080}
  • router/java/src/net/i2p/router/RouterVersion.java

    rcacd0f8 r9030b64  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 21;
     21    public final static long BUILD = 1;
    2222
    2323    /** for example "-test" */
    24     public final static String EXTRA = "-rc";
     24    public final static String EXTRA = "";
    2525    public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
    2626    public static void main(String args[]) {
  • router/java/src/net/i2p/router/transport/TransportManager.java

    rcacd0f8 r9030b64  
    460460            _log.debug("I2NPMessage received: " + message.getClass().getName(), new Exception("Where did I come from again?"));
    461461        try {
    462             int num = _context.inNetMessagePool().add(message, fromRouter, fromRouterHash);
     462            _context.inNetMessagePool().add(message, fromRouter, fromRouterHash);
    463463            if (_log.shouldLog(Log.DEBUG))
    464                 _log.debug("Added to in pool: "+ num);
     464                _log.debug("Added to in pool");
    465465        } catch (IllegalArgumentException iae) {
    466466            if (_log.shouldLog(Log.WARN))
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    rcacd0f8 r9030b64  
    710710    }
    711711
    712     private static int getShareBandwidth(RouterContext ctx) {
     712    /** @return in KBps */
     713    public static int getShareBandwidth(RouterContext ctx) {
    713714        int irateKBps = ctx.bandwidthLimiter().getInboundKBytesPerSecond();
    714715        int orateKBps = ctx.bandwidthLimiter().getOutboundKBytesPerSecond();
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    rcacd0f8 r9030b64  
    2828class BuildExecutor implements Runnable {
    2929    private final ArrayList<Long> _recentBuildIds = new ArrayList(100);
    30     private RouterContext _context;
    31     private Log _log;
    32     private TunnelPoolManager _manager;
     30    private final RouterContext _context;
     31    private final Log _log;
     32    private final TunnelPoolManager _manager;
    3333    /** list of TunnelCreatorConfig elements of tunnels currently being built */
    3434    private final Object _currentlyBuilding;
     
    3838    private final ConcurrentHashMap<Long, PooledTunnelCreatorConfig> _recentlyBuildingMap;
    3939    private boolean _isRunning;
    40     private BuildHandler _handler;
     40    private final BuildHandler _handler;
    4141    private boolean _repoll;
    4242    private static final int MAX_CONCURRENT_BUILDS = 10;
     
    249249       
    250250        //long loopBegin = 0;
    251         //long beforeHandleInboundReplies = 0;
    252         //long afterHandleInboundReplies = 0;
    253251        //long afterBuildZeroHop = 0;
    254252        long afterBuildReal = 0;
     
    269267                }
    270268
    271                 //beforeHandleInboundReplies = System.currentTimeMillis();
    272                 _handler.handleInboundReplies();
    273                 //afterHandleInboundReplies = System.currentTimeMillis();
    274                
    275269                // allowed() also expires timed out requests (for new style requests)
    276270                int allowed = allowed();
     
    328322                                buildTunnel(pool, cfg);
    329323                                realBuilt++;
    330                                
    331                                 // we want replies to go to the top of the queue
    332                                 _handler.handleInboundReplies();
    333324                            } else {
    334325                                i--;
     
    392383     *
    393384     */
    394     private static class TunnelPoolComparator implements Comparator {
    395         public int compare(Object l, Object r) {
    396             TunnelPool tpl = (TunnelPool) l;
    397             TunnelPool tpr = (TunnelPool) r;
     385    private static class TunnelPoolComparator implements Comparator<TunnelPool> {
     386        public int compare(TunnelPool tpl, TunnelPool tpr) {
    398387            if (tpl.getSettings().isExploratory() && !tpr.getSettings().isExploratory())
    399388                return -1;
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    rcacd0f8 r9030b64  
    11package net.i2p.router.tunnel.pool;
    22
    3 import java.util.ArrayList;
    43import java.util.List;
     4import java.util.concurrent.LinkedBlockingQueue;
    55
    66import net.i2p.data.Base64;
     
    2828import net.i2p.router.tunnel.BuildReplyHandler;
    2929import net.i2p.router.tunnel.HopConfig;
     30import net.i2p.router.tunnel.TunnelDispatcher;
    3031import net.i2p.stat.Rate;
    3132import net.i2p.stat.RateStat;
     
    3334
    3435/**
     36 * Handle the received tunnel build message requests and replies,
     37 * including sending responsses to requests, updating the
     38 * lists of our tunnels and participating tunnels,
     39 * and updating stats.
     40 *
     41 * Replies are handled immediately on reception; requests are queued.
    3542 *
    3643 * Note that 10 minute tunnel expiration is hardcoded in here.
    37  *
    3844 */
    3945class BuildHandler {
     
    4349    private final Job _buildMessageHandlerJob;
    4450    private final Job _buildReplyMessageHandlerJob;
    45     /** list of BuildMessageState, oldest first */
    46     private final List<BuildMessageState> _inboundBuildMessages;
    47     /** list of BuildReplyMessageState, oldest first - unused unless HANDLE_REPLIES_INLINE == false */
    48     private final List<BuildReplyMessageState> _inboundBuildReplyMessages;
    49     /** list of BuildEndMessageState, oldest first - unused unless HANDLE_REPLIES_INLINE == false */
    50     private final List<BuildEndMessageState> _inboundBuildEndMessages;
     51    private final LinkedBlockingQueue<BuildMessageState> _inboundBuildMessages;
    5152    private final BuildMessageProcessor _processor;
    5253    private final ParticipatingThrottler _throttler;
    5354
    54     private static final boolean HANDLE_REPLIES_INLINE = true;
    55    
     55    /** TODO these may be too high, review and adjust */
     56    private static final int MIN_QUEUE = 12;
     57    private static final int MAX_QUEUE = 96;
     58
    5659    public BuildHandler(RouterContext ctx, BuildExecutor exec) {
    5760        _context = ctx;
    5861        _log = ctx.logManager().getLog(getClass());
    5962        _exec = exec;
    60         _inboundBuildMessages = new ArrayList(16);
    61         if (HANDLE_REPLIES_INLINE) {
    62             _inboundBuildEndMessages = null;
    63             _inboundBuildReplyMessages = null;
    64         } else {
    65             _inboundBuildEndMessages = new ArrayList(16);
    66             _inboundBuildReplyMessages = new ArrayList(16);
    67         }
     63        // Queue size = 12 * share BW / 48K
     64        int sz = Math.min(MAX_QUEUE, Math.max(MIN_QUEUE, TunnelDispatcher.getShareBandwidth(ctx) * MIN_QUEUE / 48));
     65        _inboundBuildMessages = new LinkedBlockingQueue(sz);
    6866   
    6967        _context.statManager().createRateStat("tunnel.reject.10", "How often we reject a tunnel probabalistically", "Tunnels", new long[] { 60*1000, 10*60*1000 });
     
    9593       
    9694        _processor = new BuildMessageProcessor(ctx);
     95        _throttler = new ParticipatingThrottler(ctx);
    9796        _buildMessageHandlerJob = new TunnelBuildMessageHandlerJob(ctx);
    9897        _buildReplyMessageHandlerJob = new TunnelBuildReplyMessageHandlerJob(ctx);
     
    103102        ctx.inNetMessagePool().registerHandlerJobBuilder(VariableTunnelBuildMessage.MESSAGE_TYPE, tbmhjb);
    104103        ctx.inNetMessagePool().registerHandlerJobBuilder(VariableTunnelBuildReplyMessage.MESSAGE_TYPE, tbrmhjb);
    105         _throttler = new ParticipatingThrottler(ctx);
    106104    }
    107105   
     
    111109    /**
    112110     * Blocking call to handle a few of the pending inbound requests, returning how many
    113      * requests remain after this pass
     111     * requests remain after this pass. This is called by BuildExecutor.
    114112     */
    115113    int handleInboundRequests() {
    116         int dropExpired = 0;
    117         int remaining = 0;
    118         List handled = null;
    119         long beforeFindHandled = System.currentTimeMillis();
    120         synchronized (_inboundBuildMessages) {
    121             int toHandle = _inboundBuildMessages.size();
    122             if (toHandle > 0) {
    123                 if (toHandle > MAX_HANDLE_AT_ONCE)
    124                     toHandle = MAX_HANDLE_AT_ONCE;
    125                 handled = new ArrayList(toHandle);
    126                 //if (false) {
    127                 //    for (int i = 0; i < toHandle; i++) // LIFO for lower response time (should we RED it for DoS?)
    128                 //        handled.add(_inboundBuildMessages.remove(_inboundBuildMessages.size()-1));
    129                 //} else {
    130                     // drop any expired messages
    131                     long dropBefore = System.currentTimeMillis() - (BuildRequestor.REQUEST_TIMEOUT/4);
    132                     do {
    133                         BuildMessageState state = (BuildMessageState)_inboundBuildMessages.get(0);
    134                         if (state.recvTime <= dropBefore) {
    135                             _inboundBuildMessages.remove(0);
    136                             dropExpired++;
    137                             if (_log.shouldLog(Log.WARN))
    138                                 _log.warn("Not even trying to handle/decrypt the request " + state.msg.getUniqueId()
    139                                            + ", since we received it a long time ago: " + (System.currentTimeMillis() - state.recvTime));
    140                             _context.statManager().addRateData("tunnel.dropLoadDelay", System.currentTimeMillis() - state.recvTime, 0);
    141                         } else {
    142                             break;
    143                         }
    144                     } while (!_inboundBuildMessages.isEmpty());
    145                    
    146                     if (dropExpired > 0)
    147                         _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Too slow"));
    148 
    149                     // now pull off the oldest requests first (we're doing a tail-drop
    150                     // when adding)
    151                     for (int i = 0; i < toHandle && !_inboundBuildMessages.isEmpty(); i++)
    152                         handled.add(_inboundBuildMessages.remove(0));
    153                 //}
    154             }
    155             remaining = _inboundBuildMessages.size();
    156         }
    157         if (handled != null) {
     114        for (int i = 0; i < MAX_HANDLE_AT_ONCE; ) {
     115            BuildMessageState state = _inboundBuildMessages.poll();
     116            if (state == null)
     117                return 0;
     118            long dropBefore = System.currentTimeMillis() - (BuildRequestor.REQUEST_TIMEOUT/4);
     119            if (state.recvTime <= dropBefore) {
     120                if (_log.shouldLog(Log.WARN))
     121                    _log.warn("Not even trying to handle/decrypt the request " + state.msg.getUniqueId()
     122                              + ", since we received it a long time ago: " + (System.currentTimeMillis() - state.recvTime));
     123                _context.statManager().addRateData("tunnel.dropLoadDelay", System.currentTimeMillis() - state.recvTime, 0);
     124                _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Too slow"));
     125                continue;
     126            }       
     127
     128            i++;
     129            long beforeHandle = System.currentTimeMillis();
     130            long actualTime = handleRequest(state);
    158131            if (_log.shouldLog(Log.DEBUG))
    159                 _log.debug("Handling " + handled.size() + " requests (took " + (System.currentTimeMillis()-beforeFindHandled) + "ms to find them)");
    160            
    161             for (int i = 0; i < handled.size(); i++) {
    162                 BuildMessageState state = (BuildMessageState)handled.get(i);
    163                 long beforeHandle = System.currentTimeMillis();
    164                 long actualTime = handleRequest(state);
    165                 if (_log.shouldLog(Log.DEBUG))
    166                     _log.debug("Handle took " + (System.currentTimeMillis()-beforeHandle) + "/" + actualTime + " (" + i + " out of " + handled.size() + " with " + remaining + " remaining)");
    167             }
    168             handled.clear();
    169         }
    170         if (!HANDLE_REPLIES_INLINE) {
    171             synchronized (_inboundBuildEndMessages) {
    172                 int toHandle = _inboundBuildEndMessages.size();
    173                 if (toHandle > 0) {
    174                     if (handled == null)
    175                         handled = new ArrayList(_inboundBuildEndMessages);
    176                     else
    177                         handled.addAll(_inboundBuildEndMessages);
    178                     _inboundBuildEndMessages.clear();
    179                 }
    180             }
    181         }
    182         if (handled != null) {
    183             if (_log.shouldLog(Log.DEBUG))
    184                 _log.debug("Handling " + handled.size() + " requests that are actually replies");
    185             // these are inbound build messages that actually contain the full replies, since
    186             // they are for inbound tunnels we have created
    187             for (int i = 0; i < handled.size(); i++) {
    188                 BuildEndMessageState state = (BuildEndMessageState)handled.get(i);
    189                 handleRequestAsInboundEndpoint(state);
    190             }
    191         }
    192        
    193         // anything else?
    194         /*
    195         synchronized (_inboundBuildMessages) {
    196             int remaining = _inboundBuildMessages.size();
    197             return remaining;
    198         }
    199          */
     132                _log.debug("Handle took " + (System.currentTimeMillis()-beforeHandle) + "/" + actualTime +
     133                           " (" + i + " with " + _inboundBuildMessages.size() + " remaining)");
     134        }
     135
     136        int remaining = _inboundBuildMessages.size();
    200137        if (remaining > 0)
    201138            _context.statManager().addRateData("tunnel.handleRemaining", remaining, 0);
    202139        return remaining;
    203     }
    204    
    205     /** Warning - noop if HANDLE_REPLIES_INLINE == true */
    206     void handleInboundReplies() {
    207         if (HANDLE_REPLIES_INLINE)
    208             return;
    209         List handled = null;
    210         synchronized (_inboundBuildReplyMessages) {
    211             int toHandle = _inboundBuildReplyMessages.size();
    212             if (toHandle > 0) {
    213                 // always handle all of them - they're replies that we were waiting for!
    214                 handled = new ArrayList(_inboundBuildReplyMessages);
    215                 _inboundBuildReplyMessages.clear();
    216             }
    217         }
    218         if (handled != null) {
    219             if (_log.shouldLog(Log.DEBUG))
    220                 _log.debug("Handling " + handled.size() + " replies");
    221            
    222             for (int i = 0; i < handled.size(); i++) {
    223                 BuildReplyMessageState state = (BuildReplyMessageState)handled.get(i);
    224                 handleReply(state);
    225             }
    226         }
    227140    }
    228141   
     
    344257    }
    345258   
    346     /** @return handle time or -1 */
     259    /** @return handle time or -1 if it wasn't completely handled */
    347260    private long handleRequest(BuildMessageState state) {
    348261        long timeSinceReceived = System.currentTimeMillis()-state.recvTime;
     
    366279        long decryptTime = System.currentTimeMillis() - beforeDecrypt;
    367280        _context.statManager().addRateData("tunnel.decryptRequestTime", decryptTime, decryptTime);
    368         if (decryptTime > 500)
     281        if (decryptTime > 500 && _log.shouldLog(Log.WARN))
    369282            _log.warn("Took too long to decrypt the request: " + decryptTime + " for message " + state.msg.getUniqueId() + " received " + (timeSinceReceived+decryptTime) + " ago");
    370283        if (req == null) {
     
    380293        RouterInfo nextPeerInfo = _context.netDb().lookupRouterInfoLocally(nextPeer);
    381294        long lookupTime = System.currentTimeMillis()-beforeLookup;
    382         if (lookupTime > 500)
     295        if (lookupTime > 500 && _log.shouldLog(Log.WARN))
    383296            _log.warn("Took too long to lookup the request: " + lookupTime + "/" + readPeerTime + " for message " + state.msg.getUniqueId() + " received " + (timeSinceReceived+decryptTime) + " ago");
    384297        if (nextPeerInfo == null) {
     
    417330   
    418331    private class HandleReq extends JobImpl {
    419         private BuildMessageState _state;
    420         private BuildRequestRecord _req;
    421         private Hash _nextPeer;
     332        private final BuildMessageState _state;
     333        private final BuildRequestRecord _req;
     334        private final Hash _nextPeer;
    422335        HandleReq(RouterContext ctx, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) {
    423336            super(ctx);
     
    440353
    441354    private static class TimeoutReq extends JobImpl {
    442         private BuildMessageState _state;
    443         private BuildRequestRecord _req;
    444         private Hash _nextPeer;
     355        private final BuildMessageState _state;
     356        private final BuildRequestRecord _req;
     357        private final Hash _nextPeer;
    445358        TimeoutReq(RouterContext ctx, BuildMessageState state, BuildRequestRecord req, Hash nextPeer) {
    446359            super(ctx);
     
    581494            if (from == null)
    582495                from = state.from.calculateHash();
    583             if (_throttler.shouldThrottle(from)) {
     496            if (from != null && _throttler.shouldThrottle(from)) {
    584497                if (_log.shouldLog(Log.WARN))
    585498                    _log.warn("Rejecting tunnel (hop throttle), previous hop: " + from);
     
    732645   
    733646    public int getInboundBuildQueueSize() {
    734         synchronized (_inboundBuildMessages) {
    735647            return _inboundBuildMessages.size();
    736         }
    737648    }
    738649   
     
    757668                }
    758669                BuildEndMessageState state = new BuildEndMessageState(cfg, receivedMessage);
    759                 if (HANDLE_REPLIES_INLINE) {
    760                     handleRequestAsInboundEndpoint(state);
    761                 } else {
    762                     synchronized (_inboundBuildEndMessages) {
    763                         _inboundBuildEndMessages.add(state);
    764                     }
    765                     _exec.repoll();
    766                 }
     670                handleRequestAsInboundEndpoint(state);
    767671            } else {
    768672                if (_exec.wasRecentlyBuilding(reqId)) {
     
    772676                    _context.statManager().addRateData("tunnel.buildReplyTooSlow", 1, 0);
    773677                } else {
    774                     synchronized (_inboundBuildMessages) {
    775                         boolean removed = false;
    776                         int dropped = 0;
    777                         for (int i = 0; i < _inboundBuildMessages.size(); i++) {
    778                             BuildMessageState cur = (BuildMessageState)_inboundBuildMessages.get(i);
    779                             long age = System.currentTimeMillis() - cur.recvTime;
    780                             if (age >= BuildRequestor.REQUEST_TIMEOUT/4) {
    781                                 _inboundBuildMessages.remove(i);
    782                                 i--;
    783                                 dropped++;
    784                                 _context.statManager().addRateData("tunnel.dropLoad", age, _inboundBuildMessages.size());
    785                             }
    786                         }
    787                         if (dropped > 0) {
     678                    int sz = _inboundBuildMessages.size();
     679                    BuildMessageState cur = _inboundBuildMessages.peek();
     680                    boolean accept = true;
     681                    if (cur != null) {
     682                        long age = System.currentTimeMillis() - cur.recvTime;
     683                        if (age >= BuildRequestor.REQUEST_TIMEOUT/4) {
     684                            _context.statManager().addRateData("tunnel.dropLoad", age, sz);
    788685                            _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: High load"));
    789686                            // if the queue is backlogged, stop adding new messages
    790                             _context.statManager().addRateData("tunnel.dropLoadBacklog", _inboundBuildMessages.size(), _inboundBuildMessages.size());
     687                            _context.statManager().addRateData("tunnel.dropLoadBacklog", sz, sz);
     688                            accept = false;
     689                        }
     690                    }
     691                    if (accept) {
     692                        int queueTime = estimateQueueTime(sz);
     693                        float pDrop = queueTime/((float)BuildRequestor.REQUEST_TIMEOUT*3);
     694                        pDrop = (float)Math.pow(pDrop, 16); // steeeep
     695                        float f = _context.random().nextFloat();
     696                        //if ( (pDrop > f) && (allowProactiveDrop()) ) {
     697                        if (pDrop > f) {
     698                            _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Queue time"));
     699                            _context.statManager().addRateData("tunnel.dropLoadProactive", queueTime, sz);
    791700                        } else {
    792                             int queueTime = estimateQueueTime(_inboundBuildMessages.size());
    793                             float pDrop = queueTime/((float)BuildRequestor.REQUEST_TIMEOUT*3);
    794                             pDrop = (float)Math.pow(pDrop, 16); // steeeep
    795                             float f = _context.random().nextFloat();
    796                             if ( (pDrop > f) && (allowProactiveDrop()) ) {
    797                                 _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Queue time"));
    798                                 _context.statManager().addRateData("tunnel.dropLoadProactive", queueTime, _inboundBuildMessages.size());
     701                            accept = _inboundBuildMessages.offer(new BuildMessageState(receivedMessage, from, fromHash));
     702                            if (accept) {
     703                                // wake up the Executor to call handleInboundRequests()
     704                                _exec.repoll();
    799705                            } else {
    800                                 _inboundBuildMessages.add(new BuildMessageState(receivedMessage, from, fromHash));
     706                                _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: High load"));
     707                                _context.statManager().addRateData("tunnel.dropLoadBacklog", sz, sz);
    801708                            }
    802709                        }
    803710                    }
    804                     _exec.repoll();
    805711                }
    806712            }
     
    809715    }
    810716   
     717/****
    811718    private boolean allowProactiveDrop() {
    812         String allow = _context.getProperty("router.allowProactiveDrop", "true");
    813         boolean rv = false;
    814         if ( (allow == null) || (Boolean.valueOf(allow).booleanValue()) )
    815             rv = true;
     719        boolean rv = _context.getBooleanPropertyDefaultTrue("router.allowProactiveDrop");
    816720        if (!rv)
    817721            _context.statManager().addRateData("tunnel.dropLoadProactiveAbort", 1, 0);
    818722        return rv;
    819723    }
     724****/
    820725   
    821726    private int estimateQueueTime(int numPendingMessages) {
     
    846751                _log.debug("Receive tunnel build reply message " + receivedMessage.getUniqueId() + " from "
    847752                           + (fromHash != null ? fromHash.toBase64() : from != null ? from.calculateHash().toBase64() : "a tunnel"));
    848             if (HANDLE_REPLIES_INLINE) {
    849                 handleReply(new BuildReplyMessageState(receivedMessage));
    850             } else {
    851                 synchronized (_inboundBuildReplyMessages) {
    852                     _inboundBuildReplyMessages.add(new BuildReplyMessageState(receivedMessage));
    853                 }
    854                 _exec.repoll();
    855             }
     753            handleReply(new BuildReplyMessageState(receivedMessage));
    856754            return _buildReplyMessageHandlerJob;
    857755        }
     
    860758    /** normal inbound requests from other people */
    861759    private static class BuildMessageState {
    862         TunnelBuildMessage msg;
    863         RouterIdentity from;
    864         Hash fromHash;
    865         long recvTime;
     760        final TunnelBuildMessage msg;
     761        final RouterIdentity from;
     762        final Hash fromHash;
     763        final long recvTime;
    866764        public BuildMessageState(I2NPMessage m, RouterIdentity f, Hash h) {
    867765            msg = (TunnelBuildMessage)m;
     
    873771    /** replies for outbound tunnels that we have created */
    874772    private static class BuildReplyMessageState {
    875         TunnelBuildReplyMessage msg;
    876         long recvTime;
     773        final TunnelBuildReplyMessage msg;
     774        final long recvTime;
    877775        public BuildReplyMessageState(I2NPMessage m) {
    878776            msg = (TunnelBuildReplyMessage)m;
     
    882780    /** replies for inbound tunnels we have created */
    883781    private static class BuildEndMessageState {
    884         TunnelBuildMessage msg;
    885         PooledTunnelCreatorConfig cfg;
    886         long recvTime;
     782        final TunnelBuildMessage msg;
     783        final PooledTunnelCreatorConfig cfg;
     784        final long recvTime;
    887785        public BuildEndMessageState(PooledTunnelCreatorConfig c, I2NPMessage m) {
    888786            cfg = c;
     
    892790    }
    893791
    894     // noop
     792    /** noop */
    895793    private static class TunnelBuildMessageHandlerJob extends JobImpl {
    896794        private TunnelBuildMessageHandlerJob(RouterContext ctx) { super(ctx); }
     
    898796        public String getName() { return "Receive tunnel build message"; }
    899797    }
    900     // noop
     798
     799    /** noop */
    901800    private static class TunnelBuildReplyMessageHandlerJob extends JobImpl {
    902801        private TunnelBuildReplyMessageHandlerJob(RouterContext ctx) { super(ctx); }
     
    911810     */
    912811    private static class TunnelBuildNextHopFailJob extends JobImpl {
    913         HopConfig _cfg;
     812        final HopConfig _cfg;
    914813        private TunnelBuildNextHopFailJob(RouterContext ctx, HopConfig cfg) {
    915814            super(ctx);
  • router/java/src/net/i2p/router/tunnel/pool/BuildRequestor.java

    rcacd0f8 r9030b64  
    2323
    2424/**
    25  *
     25 *  Methods for creating Tunnel Build Messages, i.e. requests
    2626 */
    27 class BuildRequestor {
     27abstract class BuildRequestor {
    2828    private static final List<Integer> ORDER = new ArrayList(TunnelBuildMessage.MAX_RECORD_COUNT);
    2929    static {
     
    3838     *  Put the expiration in the PTCC.
    3939     *
    40      *  Also, perhaps, save the PTCC even after expiration for an extended time,
     40     *  Also, we now save the PTCC even after expiration for an extended time,
    4141     *  so can we use a successfully built tunnel anyway.
    4242     *
     
    5050    private static final int BUILD_MSG_TIMEOUT = 60*1000;
    5151
     52    /**
     53     *  "paired tunnels" means using a client's own inbound tunnel to receive the
     54     *  reply for an outbound build request, and using a client's own outbound tunnel
     55     *  to send an inbound build request.
     56     *  This is more secure than using the router's exploratory tunnels, as it
     57     *  makes correlation of multiple clients more difficult.
     58     */
    5259    private static boolean usePairedTunnels(RouterContext ctx) {
    53         String val = ctx.getProperty("router.usePairedTunnels");
    54         if ( (val == null) || (Boolean.valueOf(val).booleanValue()) )
    55             return true;
    56         else
    57             return false;
     60        return true;
     61        //return ctx.getBooleanPropertyDefaultTrue("router.usePairedTunnels");
    5862    }
    5963   
     
    322326     */
    323327    private static class TunnelBuildFirstHopFailJob extends JobImpl {
    324         TunnelPool _pool;
    325         PooledTunnelCreatorConfig _cfg;
    326         BuildExecutor _exec;
     328        final TunnelPool _pool;
     329        final PooledTunnelCreatorConfig _cfg;
     330        final BuildExecutor _exec;
    327331        private TunnelBuildFirstHopFailJob(RouterContext ctx, TunnelPool pool, PooledTunnelCreatorConfig cfg, BuildExecutor exec) {
    328332            super(ctx);
  • router/java/src/net/i2p/router/tunnel/pool/ExpireJob.java

    rcacd0f8 r9030b64  
    66import net.i2p.router.tunnel.TunnelCreatorConfig;
    77
     8/**
     9 *  This runs twice for each tunnel.
     10 *  The first time, remove it from the LeaseSet.
     11 *  The second time, stop accepting data for it.
     12 */
    813class ExpireJob extends JobImpl {
    9     private TunnelPool _pool;
    10     private TunnelCreatorConfig _cfg;
     14    private final TunnelPool _pool;
     15    private final TunnelCreatorConfig _cfg;
    1116    private boolean _leaseUpdated;
    12     private long _dropAfter;
     17    private final long _dropAfter;
     18
    1319    public ExpireJob(RouterContext ctx, TunnelCreatorConfig cfg, TunnelPool pool) {
    1420        super(ctx);
    1521        _pool = pool;
    1622        _cfg = cfg;
    17         _leaseUpdated = false;
    1823        // we act as if this tunnel expires a random skew before it actually does
    1924        // so we rebuild out of sync.  otoh, we will honor tunnel messages on it
     
    2934        getTiming().setStartAfter(expire);
    3035    }
     36
    3137    public String getName() {
    3238        return "Expire tunnel";
    3339    }
     40
    3441    public void runJob() {
    3542        if (!_leaseUpdated) {
  • router/java/src/net/i2p/router/tunnel/pool/TestJob.java

    rcacd0f8 r9030b64  
    2323
    2424class TestJob extends JobImpl {
    25     private Log _log;
    26     private TunnelPool _pool;
    27     private PooledTunnelCreatorConfig _cfg;
     25    private final Log _log;
     26    private final TunnelPool _pool;
     27    private final PooledTunnelCreatorConfig _cfg;
    2828    private boolean _found;
    2929    private TunnelInfo _outTunnel;
     
    4040        super(ctx);
    4141        _log = ctx.logManager().getLog(TestJob.class);
    42         _pool = pool;
    4342        _cfg = cfg;
    44         if (_pool == null)
     43        if (pool != null)
     44            _pool = pool;
     45        else
    4546            _pool = cfg.getTunnelPool();
    4647        if ( (_pool == null) && (_log.shouldLog(Log.ERROR)) )
     
    6263                                         RATES);
    6364    }
     65
    6466    public String getName() { return "Test tunnel"; }
     67
    6568    public void runJob() {
    6669        if (_pool == null)
     
    247250   
    248251    private class ReplySelector implements MessageSelector {
    249         private RouterContext _context;
    250         private long _id;
    251         private long _expiration;
     252        private final RouterContext _context;
     253        private final long _id;
     254        private final long _expiration;
     255
    252256        public ReplySelector(RouterContext ctx, long id, long expiration) {
    253257            _context = ctx;
     
    258262       
    259263        public boolean continueMatching() { return !_found && _context.clock().now() < _expiration; }
     264
    260265        public long getExpiration() { return _expiration; }
     266
    261267        public boolean isMatch(I2NPMessage message) {
    262268            if (message instanceof DeliveryStatusMessage) {
     
    281287        private long _successTime;
    282288        private OutNetMessage _sentMessage;
     289
    283290        public OnTestReply(RouterContext ctx) { super(ctx); }
     291
    284292        public String getName() { return "Tunnel test success"; }
     293
    285294        public void setSentMessage(OutNetMessage m) { _sentMessage = m; }
     295
    286296        public void runJob() {
    287297            if (_sentMessage != null)
     
    293303            _found = true;
    294304        }
     305
    295306        // who cares about the details...
    296307        public void setMessage(I2NPMessage message) {
     
    311322     */
    312323    private class OnTestTimeout extends JobImpl {
    313         private long _started;
     324        private final long _started;
     325
    314326        public OnTestTimeout(RouterContext ctx) {
    315327            super(ctx);
    316328            _started = ctx.clock().now();
    317329        }
     330
    318331        public String getName() { return "Tunnel test timeout"; }
     332
    319333        public void runJob() {
    320334            if (_log.shouldLog(Log.WARN))
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    rcacd0f8 r9030b64  
    2323
    2424/**
    25  *
     25 *  A group of tunnels for the router or a particular client, in a single direction.
    2626 */
    2727public class TunnelPool {
    2828    private final List _inProgress = new ArrayList();
    29     private RouterContext _context;
    30     private Log _log;
     29    private final RouterContext _context;
     30    private final Log _log;
    3131    private TunnelPoolSettings _settings;
    3232    private final ArrayList<TunnelInfo> _tunnels;
    33     private TunnelPeerSelector _peerSelector;
    34     private TunnelPoolManager _manager;
     33    private final TunnelPeerSelector _peerSelector;
     34    private final TunnelPoolManager _manager;
    3535    private boolean _alive;
    3636    private long _lifetimeProcessed;
    3737    private TunnelInfo _lastSelected;
    3838    private long _lastSelectionPeriod;
    39     private int _expireSkew;
     39    private final int _expireSkew;
    4040    private long _started;
    4141    private long _lastRateUpdate;
     
    5151        _tunnels = new ArrayList(settings.getLength() + settings.getBackupQuantity());
    5252        _peerSelector = sel;
    53         _alive = false;
    54         _lastSelectionPeriod = 0;
    55         _lastSelected = null;
    56         _lifetimeProcessed = 0;
    5753        _expireSkew = _context.random().nextInt(90*1000);
    5854        _started = System.currentTimeMillis();
    5955        _lastRateUpdate = _started;
    60         _lastLifetimeProcessed = 0;
    6156        _rateName = "tunnel.Bps." +
    6257                    (_settings.isExploratory() ? "exploratory" : _settings.getDestinationNickname()) +
     
    413408    }
    414409
     410    /** noop for outbound */
    415411    void refreshLeaseSet() {
    416         if (_log.shouldLog(Log.DEBUG))
    417             _log.debug(toString() + ": refreshing leaseSet on tunnel expiration (but prior to grace timeout)");
    418         LeaseSet ls = null;
    419412        if (_settings.isInbound() && (_settings.getDestination() != null) ) {
     413            if (_log.shouldLog(Log.DEBUG))
     414                _log.debug(toString() + ": refreshing leaseSet on tunnel expiration (but prior to grace timeout)");
     415            LeaseSet ls = null;
    420416            synchronized (_tunnels) {
    421417                ls = locked_buildNewLeaseSet();
     
    428424
    429425    /**
    430      * Return true if a fallback tunnel is built
     426     * @return true if a fallback tunnel is built
    431427     *
    432428     */
     
    852848   
    853849    PooledTunnelCreatorConfig configureNewTunnel() { return configureNewTunnel(false); }
     850
    854851    private PooledTunnelCreatorConfig configureNewTunnel(boolean forceZeroHop) {
    855852        TunnelPoolSettings settings = getSettings();
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPoolManager.java

    rcacd0f8 r9030b64  
    3838 */
    3939public class TunnelPoolManager implements TunnelManagerFacade {
    40     private RouterContext _context;
    41     private Log _log;
     40    private final RouterContext _context;
     41    private final Log _log;
    4242    /** Hash (destination) to TunnelPool */
    4343    private final Map<Hash, TunnelPool> _clientInboundPools;
     
    6262        _clientOutboundPools = new ConcurrentHashMap(4);
    6363       
    64         _isShutdown = false;
    6564        _executor = new BuildExecutor(ctx, this);
    6665        I2PThread execThread = new I2PThread(_executor, "BuildExecutor");
Note: See TracChangeset for help on using the changeset viewer.