Changeset a1ec8382


Ignore:
Timestamp:
Oct 14, 2009 4:20:00 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fdc9e11
Parents:
7da4651
Message:
  • oldconsole.jsp: Remove almost all of it, tweaks for tino
  • Router: add router.hideFloodfillParticipant option for testing
File:
1 edited

Legend:

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

    r7da4651 ra1ec8382  
    464464        }
    465465       
    466         if (FloodfillNetworkDatabaseFacade.floodfillEnabled(_context))
     466        // if prop set to true, don't tell people we are ff even if we are
     467        if (FloodfillNetworkDatabaseFacade.floodfillEnabled(_context) &&
     468            !Boolean.valueOf(_context.getProperty("router.hideFloodfillParticipant")).booleanValue())
    467469            ri.addCapability(FloodfillNetworkDatabaseFacade.CAPACITY_FLOODFILL);
    468470       
    469         if("true".equalsIgnoreCase(_context.getProperty(Router.PROP_HIDDEN, "false")))
     471        if(Boolean.valueOf(_context.getProperty(PROP_HIDDEN)).booleanValue())
    470472            ri.addCapability(RouterInfo.CAPABILITY_HIDDEN);
    471473       
    472         String forceUnreachable = _context.getProperty(PROP_FORCE_UNREACHABLE);
    473         if ( (forceUnreachable != null) && ("true".equalsIgnoreCase(forceUnreachable)) ) {
     474        if (Boolean.valueOf(_context.getProperty(PROP_FORCE_UNREACHABLE)).booleanValue()) {
    474475            ri.addCapability(CAPABILITY_UNREACHABLE);
    475476            return;
     
    583584    }
    584585   
     586    /**
     587     *  this is for oldconsole.jsp, pretty much unused except as a way to get memory info,
     588     *  so let's comment out the rest, it is available elsewhere, and we don't really
     589     *  want to spend a minute rendering a multi-megabyte page in memory.
     590     */
    585591    public void renderStatusHTML(Writer out) throws IOException {
     592/****************
    586593        out.write("<h1>Router console</h1>\n" +
    587594                   "<i><a href=\"/oldconsole.jsp\">console</a> | <a href=\"/oldstats.jsp\">stats</a></i><br>\n" +
     
    600607                   "</select> <input type=\"submit\" value=\"GO\" /> </form>" +
    601608                   "<hr>\n");
    602 
    603         StringBuilder buf = new StringBuilder(32*1024);
    604        
     609**************/
     610
     611        StringBuilder buf = new StringBuilder(4*1024);
     612       
     613        // Please don't change the text or formatting, tino matches it in his scripts
    605614        if ( (_routerInfo != null) && (_routerInfo.getIdentity() != null) )
    606615            buf.append("<b>Router: </b> ").append(_routerInfo.getIdentity().getHash().toBase64()).append("<br>\n");
    607         buf.append("<b>As of: </b> ").append(new Date(_context.clock().now())).append(" (uptime: ").append(DataHelper.formatDuration(getUptime())).append(") <br>\n");
     616        buf.append("<b>As of: </b> ").append(new Date(_context.clock().now())).append("<br>\n");
     617        buf.append("<b>RouterUptime: </b> " ).append(DataHelper.formatDuration(getUptime())).append(" <br>\n");
    608618        buf.append("<b>Started on: </b> ").append(new Date(getWhenStarted())).append("<br>\n");
    609619        buf.append("<b>Clock offset: </b> ").append(_context.clock().getOffset()).append("ms (OS time: ").append(new Date(_context.clock().now() - _context.clock().getOffset())).append(")<br>\n");
     620        buf.append("<b>RouterVersion:</b> ").append(RouterVersion.FULL_VERSION).append(" / SDK: ").append(CoreVersion.VERSION).append("<br>\n");
    610621        long tot = Runtime.getRuntime().totalMemory()/1024;
    611622        long free = Runtime.getRuntime().freeMemory()/1024;
    612623        buf.append("<b>Memory:</b> In use: ").append((tot-free)).append("KB Free: ").append(free).append("KB <br>\n");
    613         buf.append("<b>Version:</b> Router: ").append(RouterVersion.VERSION).append(" / SDK: ").append(CoreVersion.VERSION).append("<br>\n");
    614624        if (_higherVersionSeen)
    615625            buf.append("<b><font color=\"red\">HIGHER VERSION SEEN</font><b> - please <a href=\"http://www.i2p.net/\">check</a> to see if there is a new release out<br>\n");
    616626
     627/*********
    617628        buf.append("<hr><a name=\"bandwidth\"> </a><h2>Bandwidth</h2>\n");
    618629        long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
     
    769780        }
    770781        buf.append("</table>\n");
     782***********/
    771783        out.write(buf.toString());
    772784        out.flush();
Note: See TracChangeset for help on using the changeset viewer.