Changeset 2b8f14f


Ignore:
Timestamp:
Nov 6, 2017 11:45:57 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e4814a7
Parents:
e281620
Message:

Minor fixes and javadocs after review
Set 90 day default for event log
Format clock skew in summary bar
Constant time for password hash check

Files:
10 edited

Legend:

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

    re281620 r2b8f14f  
    23492349                // class only in standalone builds
    23502350                Class helper = Class.forName("org.klomp.snark.standalone.ConfigUIHelper");
    2351                 Method getLangSettings = helper.getMethod("getLangSettings", I2PAppContext.class);
     2351                Method getLangSettings = helper.getMethod("getLangSettings", new Class[] {I2PAppContext.class});
    23522352                String langSettings = (String) getLangSettings.invoke(null, _context);
    23532353                // If we get to here, we have the language settings
     
    39013901    }
    39023902
     3903    /** @since 0.9.32 */
    39033904    private static boolean noCollapsePanels(HttpServletRequest req) {
    39043905        // check for user agents that can't toggle the collapsible panels...
  • apps/routerconsole/java/src/net/i2p/router/update/UpdateHandler.java

    re281620 r2b8f14f  
    5050        UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources);
    5151        // set status before thread to ensure UI feedback
    52         _mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + " I2P</b>");
     52        _mgr.notifyProgress(update, "<b>" + _mgr._t("Updating I2P") + "</b>");
    5353        return update;
    5454    }
  • apps/routerconsole/java/src/net/i2p/router/update/UpdateRunner.java

    re281620 r2b8f14f  
    260260            return;
    261261        long d = currentWrite + bytesTransferred;
    262         String status = "<b>" + _t("Updating") + " I2P</b>";
     262        String status = "<b>" + _t("Updating I2P") + "</b>";
    263263        _mgr.notifyProgress(this, status, d, d + bytesRemaining);
    264264    }
  • apps/routerconsole/java/src/net/i2p/router/web/CSSHelper.java

    re281620 r2b8f14f  
    2727    private static final String PROP_XFRAME = "routerconsole.disableXFrame";
    2828    public static final String PROP_FORCE_MOBILE_CONSOLE = "routerconsole.forceMobileConsole";
     29    /** @since 0.9.32 */
    2930    public static final String PROP_EMBED_APPS = "routerconsole.embedApps";
    3031
  • apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java

    re281620 r2b8f14f  
    5555    };
    5656    private static final long DAY = 24*60*60*1000L;
    57     private static final long[] _times = { 0, DAY, 7*DAY, 30*DAY, 365*DAY };
     57    private static final long[] _times = { 0, DAY, 7*DAY, 30*DAY, 90*DAY, 365*DAY };
    5858
    5959    public EventLogHelper() {
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java

    re281620 r2b8f14f  
    336336           .append("</a>\n")
    337337
     338           // 7 days
    338339           .append("<a href=\"/events?from=604800000\" target=\"_top\" title=\"")
    339340           .append(_t("View historical log of router events"))
     
    492493           .append(":</b></td>" +
    493494                   "<td align=\"right\">")
    494            .append(_context.clock().getOffset())
    495            .append(" ms</td></tr>\n" +
     495           .append(DataHelper.formatDuration2(_context.clock().getOffset()))
     496           .append("</td></tr>\n" +
    496497
    497498                   "<tr title=\"")
     
    510511    public String renderMemoryBarHTML() {
    511512        if (_helper == null) return "";
    512         StringBuilder buf = new StringBuilder(512);
    513         buf.append(_helper.getMemoryBar());
    514         return buf.toString();
     513        return _helper.getMemoryBar();
    515514    }
    516515
     
    657656    }
    658657
     658    /** @since 0.9.32 */
    659659    public String renderPeersAdvancedHTML() {
    660660        if (_helper == null) return "";
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    re281620 r2b8f14f  
    295295    /**
    296296     * Retrieve amount of used memory.
    297      *
    298      */
    299 
     297     * @since 0.9.32 uncommented
     298     */
    300299    public String getMemory() {
    301300        DecimalFormat integerFormatter = new DecimalFormat("###,###,##0");
     
    309308    }
    310309
     310    /** @since 0.9.32 */
    311311    public String getMemoryBar() {
    312312        DecimalFormat integerFormatter = new DecimalFormat("###,###,##0");
     
    385385        return _context.peerManager().getPeersByCapability(FloodfillNetworkDatabaseFacade.CAPABILITY_FLOODFILL).size();
    386386    }
     387
    387388    /**
    388389     * How many peers the router ranks as failing.
    389      *
    390      */
    391 
     390     * @since 0.9.32 uncommented
     391     */
    392392    public int getFailingPeers() {
    393393        if (_context == null)
     
    398398
    399399    /**
    400      * How many peers totally suck.
    401      *
    402      */
    403 
     400     * How many peers are banned.
     401     * @since 0.9.32 uncommented
     402     */
    404403    public int getBanlistedPeers() {
    405404        if (_context == null)
     
    960959
    961960    public List<String> getSummaryBarSections(String page) {
    962         String config = "";
     961        String config;
    963962        if ("home".equals(page)) {
    964963            config = _context.getProperty(PROP_SUMMARYBAR + page, isAdvanced() ? DEFAULT_MINIMAL_ADVANCED : DEFAULT_MINIMAL);
  • apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java

    re281620 r2b8f14f  
    388388     * Copied from ConfigNetHelper.
    389389     * @return in KBytes per second
     390     * @since 0.9.32
    390391     */
    391392    private int getShareBandwidth() {
  • apps/routerconsole/jsp/logs.jsp

    re281620 r2b8f14f  
    7575<table id="eventlogs" class="logtable"><tbody>
    7676<tr><td>
    77  <p><a href="events"><%=intl._t("View event logs")%></a></p>
     77 <!-- 90 days --><p><a href="events?from=7776000000"><%=intl._t("View event logs")%></a></p>
    7878</td></tr>
    7979</tbody></table>
  • core/java/src/net/i2p/util/PasswordManager.java

    re281620 r2b8f14f  
    120120        System.arraycopy(shashBytes, SALT_LENGTH, hash, 0, SessionKey.KEYSIZE_BYTES);
    121121        byte[] pwHash = _context.keyGenerator().generateSessionKey(salt, DataHelper.getUTF8(pw)).getData();
    122         return DataHelper.eq(hash, pwHash);
     122        return DataHelper.eqCT(hash, 0, pwHash, 0, SessionKey.KEYSIZE_BYTES);
    123123    }
    124124   
Note: See TracChangeset for help on using the changeset viewer.