Changeset 6019cf81


Ignore:
Timestamp:
Nov 9, 2009 5:15:19 PM (10 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
b4615ed
Parents:
e3d9452
Message:
  • Console:
    • Tag tunnel status
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/bmsg.sh

    re3d9452 r6019cf81  
    3333fi
    3434
    35 JPATHS="src ../jsp/WEB-INF strings $JFILE"
     35# list specific files in router/ here, so we don't scan the whole tree
     36ROUTERFILES="\
     37   ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \
     38   ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java"
     39JPATHS="src ../jsp/WEB-INF strings $JFILE $ROUTERFILES"
    3640for i in ../locale/messages_*.po
    3741do
  • apps/routerconsole/java/bundle-messages.sh

    re3d9452 r6019cf81  
    2222fi
    2323
    24 JPATHS="src ../jsp/WEB-INF strings $JFILE"
     24# list specific files in router/ here, so we don't scan the whole tree
     25ROUTERFILES="\
     26   ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \
     27   ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java"
     28JPATHS="src ../jsp/WEB-INF strings $JFILE $ROUTERFILES"
    2529for i in ../locale/messages_*.po
    2630do
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java

    re3d9452 r6019cf81  
    402402
    403403                   "</table><hr><h4>")
    404            .append(_helper.getTunnelStatus())
     404           .append(_(_helper.getTunnelStatus()))
    405405           .append("</h4><hr>\n")
    406406           .append(_helper.getDestinations());
  • apps/routerconsole/java/strings/Strings.java

    re3d9452 r6019cf81  
    3434        _("IRC proxy");
    3535        _("eepsite");
     36        // older names for pre-0.7.4 installs
     37        _("eepProxy");
     38        _("ircProxy");
    3639        // hardcoded in i2psnark
    3740        _("I2PSnark");
     41        // hardcoded in iMule?
     42        _("iMule");
    3843
    3944        // standard themes for ConfigUIHelper
  • installer/resources/countries.txt

    re3d9452 r6019cf81  
    117117KY,Cayman Islands
    118118KZ,Kazakhstan
    119 LA,Lao People'S Democratic Republic
     119LA,Lao People's Democratic Republic
    120120LB,Lebanon
    121121LC,Saint Lucia
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    re3d9452 r6019cf81  
    8989            if (_log.shouldLog(Log.WARN))
    9090                _log.warn("Refusing tunnel request since we are shutting down ASAP");
    91             setTunnelStatus("Rejecting tunnels: Shutting down");
     91            setTunnelStatus(_x("Rejecting tunnels: Shutting down"));
    9292            // Don't use CRIT because this tells everybody we are shutting down
    9393            return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
     
    138138                            + " ms over the last two minutes, which is too much.");
    139139                }
    140                 setTunnelStatus("Rejecting tunnels: High message delay");
     140                setTunnelStatus(_x("Rejecting tunnels: High message delay"));
    141141                return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
    142142            }
     
    172172                                      + " current=" + numTunnels + ")");
    173173                        _context.statManager().addRateData("router.throttleTunnelProbTooFast", (long)(numTunnels-avg), 0);
    174                         setTunnelStatus("Rejecting " + (100 - (int) probAccept*100) + "% of tunnels: High number of requests");
     174                        // hard to do {0} from here
     175                        //setTunnelStatus("Rejecting " + (100 - (int) probAccept*100) + "% of tunnels: High number of requests");
     176                        setTunnelStatus(_x("Rejecting most tunnels: High number of requests"));
    175177                        return TunnelHistory.TUNNEL_REJECT_PROBABALISTIC_REJECT;
    176178                    }
     
    206208                        _log.info("Probabalistically accept tunnel request (p=" + probAccept
    207209                                  + " v=" + v + " test time avg 1m=" + avg1m + " 10m=" + avg10m + ")");
    208                 } else if (false) {
    209                     if (_log.shouldLog(Log.WARN))
    210                         _log.warn("Probabalistically refusing tunnel request (test time avg 1m=" + avg1m
    211                                   + " 10m=" + avg10m + ")");
    212                     _context.statManager().addRateData("router.throttleTunnelProbTestSlow", (long)(avg1m-avg10m), 0);
    213                     setTunnelStatus("Rejecting " + ((int) probAccept*100) + "% of tunnels: High test time");
    214                     return TunnelHistory.TUNNEL_REJECT_PROBABALISTIC_REJECT;
     210                //} else if (false) {
     211                //    if (_log.shouldLog(Log.WARN))
     212                //        _log.warn("Probabalistically refusing tunnel request (test time avg 1m=" + avg1m
     213                //                  + " 10m=" + avg10m + ")");
     214                //    _context.statManager().addRateData("router.throttleTunnelProbTestSlow", (long)(avg1m-avg10m), 0);
     215                //    setTunnelStatus("Rejecting " + ((int) probAccept*100) + "% of tunnels: High test time");
     216                //    return TunnelHistory.TUNNEL_REJECT_PROBABALISTIC_REJECT;
    215217                }
    216218            } else {
     
    228230                          + numTunnels + " (our max is " + max + ")");
    229231            _context.statManager().addRateData("router.throttleTunnelMaxExceeded", numTunnels, 0);
    230             setTunnelStatus("Rejecting tunnels: Limit reached");
     232            setTunnelStatus(_x("Rejecting tunnels: Limit reached"));
    231233            return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
    232234        }
     
    296298    /** also limited to 90% - see below */
    297299    private static final int MIN_AVAILABLE_BPS = 4*1024; // always leave at least 4KBps free when allowing
    298     private static final String LIMIT_STR = "Rejecting tunnels: Bandwidth limit";
     300    private static final String LIMIT_STR = _x("Rejecting tunnels: Bandwidth limit");
    299301   
    300302    /**
     
    364366                setTunnelStatus(LIMIT_STR);
    365367            else if (probReject >= 0.5)
    366                 setTunnelStatus("Rejecting " + ((int)(100.0*probReject)) + "% of tunnels: Bandwidth limit");
     368                // hard to do {0} from here
     369                //setTunnelStatus("Rejecting " + ((int)(100.0*probReject)) + "% of tunnels: Bandwidth limit");
     370                setTunnelStatus(_x("Rejecting most tunnels: Bandwidth limit"));
    367371            else if(probReject >= 0.1)
    368                 setTunnelStatus("Accepting " + (100-(int)(100.0*probReject)) + "% of tunnels");
     372                // hard to do {0} from here
     373                //setTunnelStatus("Accepting " + (100-(int)(100.0*probReject)) + "% of tunnels");
     374                setTunnelStatus(_x("Accepting most tunnels"));
    369375            else
    370                 setTunnelStatus("Accepting tunnels");
     376                setTunnelStatus(_x("Accepting tunnels"));
    371377            return !reject;
    372378       
     
    478484//            setTunnelStatus("Not expecting tunnel requests: Advertised bandwidth too low");
    479485//        else
    480             setTunnelStatus("Rejecting tunnels");
     486            setTunnelStatus(_x("Rejecting tunnels"));
    481487    }
    482488
     
    486492
    487493    protected RouterContext getContext() { return _context; }
     494
     495    /**
     496     *  Mark a string for extraction by xgettext and translation.
     497     *  Use this only in static initializers.
     498     *  It does not translate!
     499     *  @return s
     500     */
     501    private static final String _x(String s) {
     502        return s;
     503    }
    488504}
  • router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java

    re3d9452 r6019cf81  
    126126                   
    127127                    if (dropExpired > 0)
    128                         _context.throttle().setTunnelStatus("Dropping tunnel requests: Too slow");
     128                        _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Too slow"));
    129129
    130130                    // now pull off the oldest requests first (we're doing a tail-drop
     
    338338        if (timeSinceReceived > (BuildRequestor.REQUEST_TIMEOUT*3)) {
    339339            // don't even bother, since we are so overloaded locally
    340             _context.throttle().setTunnelStatus("Dropping tunnel requests: Overloaded");
     340            _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Overloaded"));
    341341            if (_log.shouldLog(Log.WARN))
    342342                _log.warn("Not even trying to handle/decrypt the request " + state.msg.getUniqueId()
     
    497497            if (_context.random().nextFloat() < pDrop) { // || (proactiveDrops > MAX_PROACTIVE_DROPS) ) ) {
    498498                _context.statManager().addRateData("tunnel.rejectOverloaded", recvDelay, proactiveDrops);
    499                 _context.throttle().setTunnelStatus("Rejecting tunnels: Request overload");
     499                _context.throttle().setTunnelStatus(_x("Rejecting tunnels: Request overload"));
    500500                if (true || (proactiveDrops < MAX_PROACTIVE_DROPS*2))
    501501                    response = TunnelHistory.TUNNEL_REJECT_TRANSIENT_OVERLOAD;
     
    522522            ((isInGW && ! _context.commSystem().haveInboundCapacity(87)) ||
    523523             (isOutEnd && ! _context.commSystem().haveOutboundCapacity(87)))) {
    524                 _context.throttle().setTunnelStatus("Rejecting tunnels: Connection limit");
     524                _context.throttle().setTunnelStatus(_x("Rejecting tunnels: Connection limit"));
    525525                response = TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
    526526        }
     
    723723                        }
    724724                        if (dropped > 0) {
    725                             _context.throttle().setTunnelStatus("Dropping tunnel requests: High load");
     725                            _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: High load"));
    726726                            // if the queue is backlogged, stop adding new messages
    727727                            _context.statManager().addRateData("tunnel.dropLoadBacklog", _inboundBuildMessages.size(), _inboundBuildMessages.size());
     
    732732                            float f = _context.random().nextFloat();
    733733                            if ( (pDrop > f) && (allowProactiveDrop()) ) {
    734                                 _context.throttle().setTunnelStatus("Dropping tunnel requests: Queue time");
     734                                _context.throttle().setTunnelStatus(_x("Dropping tunnel requests: Queue time"));
    735735                                _context.statManager().addRateData("tunnel.dropLoadProactive", queueTime, _inboundBuildMessages.size());
    736736                            } else {
     
    861861        }
    862862    }
     863
     864    /**
     865     *  Mark a string for extraction by xgettext and translation.
     866     *  Use this only in static initializers.
     867     *  It does not translate!
     868     *  @return s
     869     */
     870    private static final String _x(String s) {
     871        return s;
     872    }
    863873}
Note: See TracChangeset for help on using the changeset viewer.