Changeset c73b5b9


Ignore:
Timestamp:
Apr 29, 2018 6:51:38 PM (2 years ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
8ed1b96
Parents:
e308804 (diff), cdd58f1 (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 '4d8cced5819f256dd03cd1a845bcb08fe8de9319'

and '76cdc242b9b68e5fef39dfe67cf27baf29872f2f'

Files:
3 added
32 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/build.xml

    re308804 rc73b5b9  
    203203        <zipfileset src="build/i2psnark.jar" />
    204204        <zipfileset src="../../../core/java/build/i2p.jar" />
    205         <zipfileset src="../../jetty/jettylib/commons-logging.jar"  />
    206205      <!-- without this we get a warning about 'no JSP support' but that's it
    207206        <zipfileset src="../../jetty/jettylib/jasper-runtime.jar"  />
  • apps/i2ptunnel/java/build.xml

    re308804 rc73b5b9  
    5757            destdir="./build/obj"
    5858            includeAntRuntime="false"
    59             classpath="../../../core/java/build/i2p.jar:build/i2ptunnel.jar:../../jetty/jettylib/jetty-i2p.jar:../../jetty/jettylib/jetty-xml.jar" >
     59            classpath="../../../core/java/build/i2p.jar:build/i2ptunnel.jar:../../jetty/jettylib/jetty-i2p.jar:../../jetty/jettylib/jetty-util.jar:../../jetty/jettylib/jetty-xml.jar" >
    6060            <compilerarg line="${javac.compilerargs}" />
    6161        </javac>
     
    319319
    320320                <pathelement location="../../jetty/jettylib/jasper-el.jar" />
    321                 <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    322321                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    323322                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     
    354353                <pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
    355354
    356                 <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    357355                <pathelement location="../../jetty/jettylib/commons-el.jar" />
     356                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
    358357                <pathelement location="build/i2ptunnel.jar" />
    359358                <pathelement location="build/temp-beans.jar" />
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    re308804 rc73b5b9  
    775775                                            out.write(_t("Conflicting address helper destination").getBytes("UTF-8"));
    776776                                            out.write(("</a></th></tr>\n").getBytes("UTF-8"));
    777                                             if (_context.portMapper().getPort(PortMapper.SVC_IMAGEGEN) > 0) {
     777                                            if (_context.portMapper().isRegistered(PortMapper.SVC_IMAGEGEN)) {
    778778                                                out.write(("<tr><td align=\"center\">" +
    779779                                                       "<a href=\"" + trustedURL + "\">" +
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java

    re308804 rc73b5b9  
    545545        StringBuilder out = new StringBuilder(2048);
    546546        try {
    547             boolean hasSusiDNS = ctx.portMapper().getPort(PortMapper.SVC_SUSIDNS) > 0;
    548             boolean hasI2PTunnel = ctx.portMapper().getPort(PortMapper.SVC_I2PTUNNEL) > 0;
     547            boolean hasSusiDNS = ctx.portMapper().isRegistered(PortMapper.SVC_SUSIDNS);
     548            boolean hasI2PTunnel = ctx.portMapper().isRegistered(PortMapper.SVC_I2PTUNNEL);
    549549            if (hasSusiDNS && hasI2PTunnel) {
    550550                reader = new TranslateReader(ctx, BUNDLE_NAME, new FileInputStream(file));
     
    822822        // The css is hiding this div for now, but we'll keep it here anyway
    823823        // Tag the strings below for translation if we unhide it.
    824         StringBuilder buf = new StringBuilder(128);
    825         buf.append("<div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ")
    826            .append(new Date().toString())
    827            .append("</i></div>\n</body>\n</html>\n");
    828         return buf.toString();
     824        //StringBuilder buf = new StringBuilder(128);
     825        //buf.append("<div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ")
     826        //   .append(new Date().toString())
     827        //   .append("</i></div>\n</body>\n</html>\n");
     828        //return buf.toString();
     829        return "</body>\n</html>\n";
    829830    }
    830831
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/TunnelControllerGroup.java

    re308804 rc73b5b9  
    4646    private final List<TunnelController> _controllers;
    4747    private final ReadWriteLock _controllersLock;
     48    // locking: this
    4849    private boolean _controllersLoaded;
    49     private final Object _controllersLoadedLock = new Object();
    5050    private final String _configFile;
    5151   
     
    156156            if (DEFAULT_CONFIG_FILE.equals(_configFile) && !_context.isRouterContext()) {
    157157                // for i2ptunnel command line
    158                 synchronized (_controllersLoadedLock) {
     158                synchronized (this) {
    159159                    _controllersLoaded = true;
    160160                }
     
    264264     */
    265265    public synchronized void loadControllers(String configFile) {
    266         synchronized (_controllersLoadedLock) {
    267             if (_controllersLoaded)
    268                 return;
    269         }
     266        if (_controllersLoaded)
     267            return;
    270268
    271269        Properties cfg = loadConfig(configFile);
     
    285283        }
    286284
    287         synchronized (_controllersLoadedLock) {
    288             _controllersLoaded = true;
    289         }
     285        _controllersLoaded = true;
    290286        if (i > 0) {
    291287            if (_log.shouldLog(Log.INFO))
     
    347343     */
    348344    public synchronized void unloadControllers() {
    349         synchronized (_controllersLoadedLock) {
    350             if (!_controllersLoaded)
    351                 return;
    352         }
     345        if (!_controllersLoaded)
     346            return;
    353347
    354348        _controllersLock.writeLock().lock();
     
    360354        }
    361355
    362         synchronized (_controllersLoadedLock) {
    363             _controllersLoaded = false;
    364         }
     356        _controllersLoaded = false;
    365357        if (_log.shouldLog(Log.INFO))
    366358            _log.info("All controllers stopped and unloaded");
     
    578570     */
    579571    public List<TunnelController> getControllers() {
    580         synchronized (_controllersLoadedLock) {
     572        synchronized (this) {
    581573            if (!_controllersLoaded)
    582574                loadControllers(_configFile);
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java

    re308804 rc73b5b9  
    218218                  "<a href=\"" + conURL + "\" title=\"" + _t("Router Console") + "\"><img src=\"http://proxy.i2p/themes/console/images/i2plogo.png\" alt=\"I2P Router Console\" border=\"0\"></a><hr>\n" +
    219219                  "<a href=\"" + conURL + "config\">" + _t("Configuration") + "</a> <a href=\"" + conURL + "help.jsp\">" + _t("Help") + "</a>").getBytes("UTF-8"));
    220         if (pm.getPort(PortMapper.SVC_SUSIDNS) > 0)
     220        if (pm.isRegistered(PortMapper.SVC_SUSIDNS))
    221221            out.write((" <a href=\"" + conURL + "susidns/index\">" + _t("Addressbook") + "</a>\n").getBytes("UTF-8"));
    222222        out.write(("</div>" +
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java

    re308804 rc73b5b9  
    135135    }
    136136
    137     /** do we know this nonce? @since 0.8.1 */
    138     private static boolean haveNonce(String nonce) {
     137    /**
     138      * do we know this nonce?
     139      * @since 0.8.1 public since 0.9.35
     140      */
     141    public static boolean haveNonce(String nonce) {
    139142        synchronized (_nonces) {
    140143            return _nonces.contains(nonce);
  • apps/i2ptunnel/jsp/web.xml

    re308804 rc73b5b9  
    6969
    7070    <servlet-mapping>
     71        <servlet-name>net.i2p.i2ptunnel.jsp.ssl_jsp</servlet-name>
     72        <url-pattern>/ssl</url-pattern>
     73    </servlet-mapping>
     74
     75    <servlet-mapping>
    7176      <servlet-name>net.i2p.servlet.ErrorServlet</servlet-name>
    7277      <url-pattern>/error</url-pattern>
  • apps/jetty/build.xml

    re308804 rc73b5b9  
    229229         jasper.jar : jasper-runtime.jar
    230230         jasper-el.jar + el-api.jar : commons-el.jar
    231          tomcat-juli.jar : Add to commons-logging.jar
     231         tomcat-juli.jar : Add to jasper-runtime.jar
    232232         empty jar : jasper-compiler.jar
    233233         Also, take NOTICE and LICENSE out of each one, we bundle those separately.
     
    341341            <classpath>
    342342                <pathelement location="../../../core/java/build/i2p.jar" />
    343                 <pathelement location="./jettylib/commons-logging.jar" />
    344343                <pathelement location="./jettylib/org.mortbay.jetty.jar" />
    345344                <pathelement location="./jettylib/javax.servlet.jar" />
     
    362361            destdir="./build/obj"
    363362            includeAntRuntime="false"
    364             classpath="../../core/java/build/i2p.jar:./jettylib/commons-logging.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-security.jar:./jettylib/jetty-servlet.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
     363            classpath="../../core/java/build/i2p.jar:./jettylib/javax.servlet.jar:./jettylib/org.mortbay.jetty.jar:./jettylib/jetty-http.jar:./jettylib/jetty-io.jar:./jettylib/jetty-security.jar:./jettylib/jetty-servlet.jar:./jettylib/jetty-util.jar:./jettylib/jetty-xml.jar" >
    365364            <compilerarg line="${javac.compilerargs}" />
    366365        </javac>
  • apps/jetty/java/src/net/i2p/servlet/ErrorServlet.java

    re308804 rc73b5b9  
    149149        out.println("</div></body></html>");
    150150        out.close();
     151    }
     152   
     153    /**
     154     *  Needed if the errored page was a POST
     155     *  @since 0.9.35
     156     */
     157    @Override
     158    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
     159        doGet(req, resp);
    151160    }
    152161
  • apps/jetty/java/src/net/i2p/servlet/I2PDefaultServlet.java

    re308804 rc73b5b9  
    215215        String encodedBase = hrefEncodeURI(base);
    216216       
    217         DateFormat dfmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.UK);
     217        DateFormat dfmt = new SimpleDateFormat(FORMAT, Locale.UK);
    218218        TimeZone utc = TimeZone.getTimeZone("GMT");
    219219        dfmt.setTimeZone(utc);
  • apps/routerconsole/java/build.xml

    re308804 rc73b5b9  
    397397                <pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
    398398
    399                 <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    400399                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    401400                <pathelement location="../../jetty/jettylib/jetty-util.jar" />
     
    436435                <pathelement location="../../jetty/jettylib/tomcat-util-scan.jar" />
    437436
    438                 <pathelement location="../../jetty/jettylib/commons-logging.jar" />
    439437                <pathelement location="../../jetty/jettylib/commons-el.jar" />
    440438                <pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java

    re308804 rc73b5b9  
    176176            if (shouldProxy && proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
    177177                proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
    178                 _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
     178                !_context.portMapper().isRegistered(PortMapper.SVC_HTTP_PROXY)) {
    179179                addFormError(_t("HTTP client proxy tunnel must be running"));
    180180                return;
  • apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java

    re308804 rc73b5b9  
    173173        if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
    174174            proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
    175             ctx.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
     175            !ctx.portMapper().isRegistered(PortMapper.SVC_HTTP_PROXY)) {
    176176            mgr.notifyComplete(null, Messages.getString("Plugin update check failed", ctx) +
    177177                                     " - " +
  • apps/routerconsole/java/src/net/i2p/router/web/WebAppStarter.java

    re308804 rc73b5b9  
    5353     *  Prior to 0.9.28, was not guaranteed to throw on failure.
    5454     *  Not for routerconsole.war, it's started in RouterConsoleRunner.
     55     *
     56     *  As of 0.9.34, the appName will be registered with the PortMapper.
    5557     *
    5658     *  @throws Exception just about anything, caller would be wise to catch Throwable
     
    166168    }
    167169
    168     /** @since public since 0.9.33; was package private */
     170    /**
     171     *  As of 0.9.34, the appName will be registered with the PortMapper,
     172     *  and PortMapper.isRegistered() will be more efficient than this.
     173     *
     174     *  @since public since 0.9.33; was package private
     175     */
    169176    public static boolean isWebAppRunning(String appName) {
    170177        ContextHandler wac = getWebApp(appName);
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/CertHelper.java

    re308804 rc73b5b9  
    2323    private static final String I2PTUNNEL_DIR = "i2ptunnel";
    2424    private static final String SAM_DIR = "sam";
    25     private static final String EEPSITE = "eepsite/etc/keystore.ks";
     25    private static final String EEPSITE_DIR = "eepsite";
    2626
    2727    public String getSummary() {
     
    3232            _out.write("</h3>\n");
    3333            // console
    34             output("Console", new File(dir, CONSOLE));
     34            output(_t("Router Console"), new File(dir, CONSOLE));
    3535            // I2CP
    36             output("I2CP", new File(dir, I2CP));
     36            output(_t("I2CP"), new File(dir, I2CP));
    3737
    3838            // i2ptunnel clients
     
    5959                for (int i = 0; i < tunnels.length; i++) {
    6060                    File f = tunnels[i];
    61                     output("SAM", f);
     61                    output(_t("SAM"), f);
    6262                    hasTunnels = true;
    6363                }
     
    6565            if (!hasTunnels)
    6666                output(_t("SAM"), null);
     67
     68            // Eepsite
     69            tunnelDir = new File(dir, EEPSITE_DIR);
     70            hasTunnels = false;
     71            tunnels = tunnelDir.listFiles(new FileSuffixFilter(".crt"));
     72            if (tunnels != null) {
     73                for (int i = 0; i < tunnels.length; i++) {
     74                    File f = tunnels[i];
     75                    String name = f.getName();
     76                    output(_t("Website") + ' ' + name.substring(0, name.length() - 4), f);
     77                    hasTunnels = true;
     78                }
     79            }
     80            if (!hasTunnels)
     81                output(_t("Website"), null);
    6782
    6883            // Family
     
    7590                f = new File(f, family + ".crt");
    7691                output(_t("Family") + ": " + DataHelper.escapeHTML(family), f);
    77             } else {
    78                 _out.write("<p>");
    79                 _out.write(_t("none"));
    80                 _out.write("</p>\n");
    81             }
    82 
    83             // Eepsite
    84             _out.write("<h3>");
    85             _out.write(_t("Website"));
    86             _out.write("</h3>\n");
    87             File ks = new File(_context.getConfigDir(), EEPSITE);
    88             if (ks.exists()) {
    89                 // TODO
    9092            } else {
    9193                _out.write("<p>");
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigClientsHandler.java

    re308804 rc73b5b9  
    578578            (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
    579579             proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
    580              _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0);
     580             !_context.portMapper().isRegistered(PortMapper.SVC_HTTP_PROXY));
    581581        if (!rv)
    582582            addFormError(_t("HTTP client proxy tunnel must be running"));
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/HomeHelper.java

    re308804 rc73b5b9  
    209209                // check for disabled webapps and other things
    210210                if (url.equals("/dns")) {
    211                     if (pm.getPort("susidns") <= 0)
     211                    if (!pm.isRegistered("susidns"))
    212212                        continue;
    213213                } else if (url.equals("/webmail")) {
    214                     if (pm.getPort("susimail") <= 0)
     214                    if (!pm.isRegistered("susimail"))
    215215                        continue;
    216216                } else if (url.equals("/torrents")) {
    217                     if (pm.getPort("i2psnark") <= 0)
     217                    if (!pm.isRegistered("i2psnark"))
    218218                        continue;
    219219                } else if (url.equals("/configplugins")) {
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/NetDbRenderer.java

    re308804 rc73b5b9  
    291291          }
    292292
    293           boolean linkSusi = WebAppStarter.isWebAppRunning("susidns");
     293          boolean linkSusi = _context.portMapper().isRegistered("susidns");
    294294          long now = _context.clock().now();
    295295          buf.append("<div class=\"leasesets_container\">");
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryBarRenderer.java

    re308804 rc73b5b9  
    215215
    216216        PortMapper pm = _context.portMapper();
    217         if (pm.getPort(PortMapper.SVC_SUSIMAIL) > 0) {
     217        if (pm.isRegistered(PortMapper.SVC_SUSIMAIL)) {
    218218           buf.append("<a href=\"/webmail\" target=\"_top\" title=\"")
    219219           .append(_t("Anonymous webmail client"))
     
    223223        }
    224224
    225         if (pm.getPort(PortMapper.SVC_I2PSNARK) > 0) {
     225        if (pm.isRegistered(PortMapper.SVC_I2PSNARK)) {
    226226           buf.append("<a href=\"/torrents\" target=\"_top\" title=\"")
    227227           .append(_t("Built-in anonymous BitTorrent Client"))
     
    270270
    271271        PortMapper pm = _context.portMapper();
    272         if (pm.getPort(PortMapper.SVC_SUSIDNS) > 0) {
     272        if (pm.isRegistered(PortMapper.SVC_SUSIDNS)) {
    273273           buf.append("<a href=\"/dns\" target=\"_top\" title=\"")
    274274           .append(_t("Manage your I2P hosts file here (I2P domain name resolution)"))
     
    292292           .append("</a>\n");
    293293
    294         if (pm.getPort(PortMapper.SVC_I2PTUNNEL) > 0) {
     294        if (pm.isRegistered(PortMapper.SVC_I2PTUNNEL)) {
    295295           buf.append("<a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"")
    296296           .append(_t("Local Tunnels"))
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java

    re308804 rc73b5b9  
    559559
    560560        StringBuilder buf = new StringBuilder(512);
    561         boolean link = WebAppStarter.isWebAppRunning("i2ptunnel");
     561        boolean link = _context.portMapper().isRegistered("i2ptunnel");
    562562        buf.append("<h3>");
    563563        if (link) {
     
    899899            !NewsHelper.isUpdateInProgress() &&
    900900            !_context.router().gracefulShutdownInProgress() &&
    901             _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) > 0 &&  // assume using proxy for now
     901            _context.portMapper().isRegistered(PortMapper.SVC_HTTP_PROXY) &&  // assume using proxy for now
    902902            getAction() == null &&
    903903            getUpdateNonce() == null) {
  • apps/routerconsole/java/src/net/i2p/router/web/helpers/SybilRenderer.java

    re308804 rc73b5b9  
    815815                   .append(hash.substring(0, 6)).append("\" >[").append(_t("Full entry")).append("]</a></th><th>");
    816816            }
    817             if (_context.portMapper().getPort("imagegen") > 0)
     817            if (_context.portMapper().isRegistered("imagegen"))
    818818                buf.append("<img src=\"/imagegen/id?s=32&amp;c=" + hash.replace("=", "%3d") + "\" height=\"32\" width=\"32\"> ");
    819819            buf.append("</th></tr>\n<tr><td class=\"sybilinfo_params\" colspan=\"3\"><div class=\"sybilinfo_container\">");
  • apps/susidns/src/build.xml

    re308804 rc73b5b9  
    2929                <pathelement location="lib/standard.jar" />
    3030                <pathelement location="${lib}/jasper-runtime.jar" />
    31                 <pathelement location="${lib}/commons-logging.jar" />
    3231                <pathelement location="${lib}/jetty-util.jar" />
    3332                <pathelement location="${ant.home}/lib/ant.jar" />
  • apps/susidns/src/java/src/i2p/susi/dns/NamingServiceBean.java

    re308804 rc73b5b9  
    439439         */
    440440        public boolean haveImagegen() {
    441                 return _context.portMapper().getPort("imagegen") > 0;
     441                return _context.portMapper().isRegistered("imagegen");
    442442        }
    443443}
  • apps/susidns/src/java/src/i2p/susi/dns/SubscriptionsBean.java

    re308804 rc73b5b9  
    145145                                *******/
    146146                                        if (content != null && content.length() > 2 &&
    147                                             _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) > 0) {
     147                                            _context.portMapper().isRegistered(PortMapper.SVC_HTTP_PROXY)) {
    148148                                                message = _t("Subscriptions saved, updating addressbook from subscription sources now.");
    149149                                                          // + "<img height=\"1\" width=\"1\" alt=\"\" " +
  • apps/susimail/src/src/i2p/susi/webmail/WebMail.java

    re308804 rc73b5b9  
    629629                                                type.equals("application/pdf") || type.equals("application/x-bittorrent") ||
    630630                                                type.equals("application/pgp-encrypted") ||
    631                                                 type.equals("application/pgp-signature"))) {
     631                                                type.equals("application/pgp-signature") ||
     632                                                (type.equals("application/octet-stream") &&
     633                                                 ((mailPart.filename != null && mailPart.filename.endsWith(".asc")) ||
     634                                                  (mailPart.name != null && mailPart.name.endsWith(".asc"))))
     635                                                                   )) {
    632636                                                out.println( "<a href=\"" + myself + '?' + RAW_ATTACHMENT + '=' +
    633637                                                         mailPart.getID() +
  • build.xml

    re308804 rc73b5b9  
    589589            <manifest>
    590590                <attribute name="Main-Class" value="net.i2p.router.RouterLaunch" />
    591                 <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-runtime.jar lib/commons-logging.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-continuation.jar lib/jetty-deploy.jar lib/jetty-http.jar lib/jetty-i2p.jar lib/jetty-io.jar lib/jetty-rewrite-handler.jar lib/jetty-security.jar lib/jetty-servlet.jar lib/jetty-servlets.jar lib/jetty-start.jar lib/jetty-util.jar lib/jetty-webapp.jar lib/jetty-xml.jar" />
     591                <attribute name="Class-Path" value="lib/i2p.jar lib/router.jar lib/jbigi.jar lib/BOB.jar lib/sam.jar lib/mstreaming.jar lib/streaming.jar lib/routerconsole.jar lib/i2ptunnel.jar lib/org.mortbay.jetty.jar lib/javax.servlet.jar lib/jasper-runtime.jar lib/commons-el.jar lib/wrapper.jar lib/systray.jar lib/desktopgui.jar lib/i2psnark.jar lib/jrobin.jar lib/jstl.jar lib/standard.jar lib/jetty-continuation.jar lib/jetty-deploy.jar lib/jetty-http.jar lib/jetty-i2p.jar lib/jetty-io.jar lib/jetty-rewrite-handler.jar lib/jetty-security.jar lib/jetty-servlet.jar lib/jetty-servlets.jar lib/jetty-start.jar lib/jetty-util.jar lib/jetty-webapp.jar lib/jetty-xml.jar" />
    592592                <attribute name="Built-By" value="${build.built-by}" />
    593593                <attribute name="Build-Date" value="${build.timestamp}" />
     
    20122012            <arg value="i2p.fba"/>
    20132013            <arg value="-auxclasspath"/>
    2014             <arg value="build/commons-el.jar:build/commons-logging.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
     2014            <arg value="build/commons-el.jar:build/jasper-runtime.jar:build/javax.servlet.jar:build/org.mortbay.jetty.jar:apps/jrobin/jrobin-1.5.9.1.jar:installer/lib/wrapper/all/wrapper.jar:apps/susidns/src/lib/standard.jar:apps/susidns/src/lib/jstl.jar:apps/jrobin/jrobin-1.5.9.1.jar"/>
    20152015            <arg value="-sourcepath"/>
    20162016            <arg value="apps/BOB/src/:apps/addressbook/java/src/:apps/i2psnark/java/src/:apps/i2ptunnel/java/src/:apps/ministreaming/java/src/:apps/routerconsole/java/src/:apps/sam/java/src/:apps/streaming/java/src/:apps/susidns/src/java/src/:apps/susimail/src/src/:apps/systray/java/src/:core/java/src/:router/java/src/:installer/java/src"/>
  • history.txt

    re308804 rc73b5b9  
     12018-04-27 zzz
     2  * Tunnels: Fix and consolidate allow-zero-hop logic,
     3    prevent zero-hop client tunnels when no active peers
     4
    152018-04-24 meeh
    26  * Mac OS X launcher is still WIP, but:
     
    610  * Added new entries to mtn-ignore so we avoid any PEBCAK with commiting build directories
    711  * Added an SBT AutoPlugin named IconHelper to generate valid ICNS images for Mac OS X
     12
     132018-04-23 zzz
     14 * Clock: Fix early NPE via DoH
     15 * EepGet: Handle HTTP response line with no status text
    816
    9172018-04-23 meeh
  • router/java/src/net/i2p/router/RouterVersion.java

    re308804 rc73b5b9  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 6;
     21    public final static long BUILD = 7;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/TunnelPoolSettings.java

    re308804 rc73b5b9  
    8080    //private static final int    DEFAULT_OB_EXPL_LENGTH_VARIANCE = isSlow ? 0 : 1;
    8181
    82     public static final boolean DEFAULT_ALLOW_ZERO_HOP = true;
     82    public static final boolean DEFAULT_ALLOW_ZERO_HOP = false;
    8383    public static final int     DEFAULT_IP_RESTRICTION = 2;    // class B (/16)
    8484    private static final int MIN_PRIORITY = -25;
     
    162162    /**
    163163     * If there are no tunnels to build with, will this pool allow 0 hop tunnels?
     164     *
    164165     * Always true for exploratory.
    165      * Generally true for client, but should probably be ignored...
    166      * use getLength() + getLengthVariance() &gt; 0 instead.
    167      */
    168     public boolean getAllowZeroHop() { return _allowZeroHop; }
     166     * Prior to 0.9.35, generally true for client.
     167     * As of 0.9.35, generally false for client, but true if
     168     * getLength() + Math.min(getLengthVariance(), 0) &lt;= 0,
     169     * OR if getLengthOverride() == 0
     170     * OR if setAllowZeroHop(true) was called or set in properties.
     171     */
     172    public boolean getAllowZeroHop() {
     173        return _allowZeroHop ||
     174               _length + Math.min(_lengthVariance, 0) <= 0 ||
     175               _lengthOverride == 0;
     176    }
    169177
    170178    /**
    171179     * If there are no tunnels to build with, will this pool allow 0 hop tunnels?
    172180     * No effect on exploratory (always true)
    173      */
     181     *
     182     * @param ok if true, getAllowZeroHop() will always return true
     183     *           if false, getAllowZeroHop will return as documented.
     184     * @deprecated unused
     185     */
     186    @Deprecated
    174187    public void setAllowZeroHop(boolean ok) {
    175188        if (!_isExploratory)
  • router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java

    re308804 rc73b5b9  
    6767        _context.statManager().createRequiredRateStat("tunnel.buildRequestTime", "Time to build a tunnel request (ms)", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    6868        _context.statManager().createRateStat("tunnel.buildConfigTime", "Time to build a tunnel request (ms)", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    69         _context.statManager().createRateStat("tunnel.buildRequestZeroHopTime", "How long it takes to build a zero hop tunnel", "Tunnels", new long[] { 60*1000, 10*60*1000 });
     69        //_context.statManager().createRateStat("tunnel.buildRequestZeroHopTime", "How long it takes to build a zero hop tunnel", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    7070        //_context.statManager().createRateStat("tunnel.pendingRemaining", "How many inbound requests are pending after a pass (period is how long the pass takes)?", "Tunnels", new long[] { 60*1000, 10*60*1000 });
    7171        _context.statManager().createRateStat("tunnel.buildFailFirstHop", "How often we fail to build a OB tunnel because we can't contact the first hop", "Tunnels", new long[] { 60*1000, 10*60*1000 });
     
    536536        if (!ok)
    537537            return;
    538         long buildTime = System.currentTimeMillis() - beforeBuild;
    539         if (cfg.getLength() <= 1)
    540             _context.statManager().addRateData("tunnel.buildRequestZeroHopTime", buildTime, 0);
    541         else
     538        if (cfg.getLength() > 1) {
     539            long buildTime = System.currentTimeMillis() - beforeBuild;
    542540            _context.statManager().addRateData("tunnel.buildRequestTime", buildTime, 0);
     541        }
    543542        long id = cfg.getReplyMessageId();
    544543        if (id > 0) {
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    re308804 rc73b5b9  
    177177
    178178    private TunnelInfo selectTunnel(boolean allowRecurseOnFail) {
    179         boolean avoidZeroHop = getSettings().getLength() > 0 &&
    180                                getSettings().getLength() + getSettings().getLengthVariance() > 0;
     179        boolean avoidZeroHop = !_settings.getAllowZeroHop();
    181180       
    182181        long period = curPeriod();
     
    244243        }
    245244       
    246         if (_alive && _settings.getAllowZeroHop())
     245        if (_alive && !avoidZeroHop)
    247246            buildFallback();
    248247        if (allowRecurseOnFail)
     
    265264     */
    266265    TunnelInfo selectTunnel(Hash closestTo) {
    267         boolean avoidZeroHop = getSettings().getLength() > 0 &&
    268                                getSettings().getLength() + getSettings().getLengthVariance() > 0;
     266        boolean avoidZeroHop = !_settings.getAllowZeroHop();
    269267        TunnelInfo rv = null;
    270268        synchronized (_tunnels) {
     
    660658
    661659        if (_settings.getAllowZeroHop()) {
    662             if ( (_settings.getLength() + _settings.getLengthVariance() > 0) &&
    663                  (!_settings.isExploratory()) &&
    664                  (_context.profileOrganizer().countActivePeers() > 0) ) {
    665                 // if it is a client tunnel pool and our variance doesn't allow 0 hop, prefer failure to
    666                 // 0 hop operation (unless our router is offline)
    667                 return false;
    668             }
    669660            if (_log.shouldLog(Log.INFO))
    670661                _log.info(toString() + ": building a fallback tunnel (usable: " + usable + " needed: " + quantity + ")");
     
    848839        int wanted = getAdjustedTotalQuantity();
    849840       
    850         boolean allowZeroHop = ((getSettings().getLength() + getSettings().getLengthVariance()) <= 0);
     841        boolean allowZeroHop = _settings.getAllowZeroHop();
    851842         
    852843        /**
Note: See TracChangeset for help on using the changeset viewer.