Changeset 97f2328


Ignore:
Timestamp:
Mar 27, 2012 5:41:02 PM (8 years ago)
Author:
sponge <sponge@…>
Branches:
master
Children:
7a6e7ba
Parents:
11ff89f
Message:

allow SHOUTcast/icecast to work over the http proxy + cleanups

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r11ff89f r97f2328  
    55
    66import java.io.ByteArrayOutputStream;
    7 import java.io.BufferedReader;
    87import java.io.File;
    98import java.io.FileInputStream;
     
    7574     */
    7675    private final ConcurrentHashMap<String, String> addressHelpers = new ConcurrentHashMap(8);
    77 
    7876    /**
    7977     *  Used to protect actions via http://proxy.i2p/
    8078     */
    8179    private final String _proxyNonce;
    82 
    8380    /**
    8481     *  These are backups if the xxx.ht error page is missing.
    8582     */
    86 
    8783    private final static byte[] ERR_REQUEST_DENIED =
    88         ("HTTP/1.1 403 Access Denied\r\n"+
    89          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    90          "Cache-control: no-cache\r\n"+
    91          "\r\n"+
    92          "<html><body><H1>I2P ERROR: REQUEST DENIED</H1>"+
    93          "You attempted to connect to a non-I2P website or location.<BR>")
    94         .getBytes();
    95 
     84                                ("HTTP/1.1 403 Access Denied\r\n" +
     85            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     86            "Cache-control: no-cache\r\n" +
     87            "\r\n" +
     88            "<html><body><H1>I2P ERROR: REQUEST DENIED</H1>" +
     89            "You attempted to connect to a non-I2P website or location.<BR>").getBytes();
    9690    private final static byte[] ERR_DESTINATION_UNKNOWN =
    97         ("HTTP/1.1 503 Service Unavailable\r\n"+
    98          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    99          "Cache-control: no-cache\r\n"+
    100          "\r\n"+
    101          "<html><body><H1>I2P ERROR: DESTINATION NOT FOUND</H1>"+
    102          "That I2P Destination was not found. Perhaps you pasted in the "+
    103          "wrong BASE64 I2P Destination or the link you are following is "+
    104          "bad. The host (or the WWW proxy, if you're using one) could also "+
    105          "be temporarily offline.  You may want to <b>retry</b>.  "+
    106          "Could not find the following Destination:<BR><BR><div>")
    107         .getBytes();
    108 
    109 /*****
     91                                ("HTTP/1.1 503 Service Unavailable\r\n" +
     92            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     93            "Cache-control: no-cache\r\n" +
     94            "\r\n" +
     95            "<html><body><H1>I2P ERROR: DESTINATION NOT FOUND</H1>" +
     96            "That I2P Destination was not found. Perhaps you pasted in the " +
     97            "wrong BASE64 I2P Destination or the link you are following is " +
     98            "bad. The host (or the WWW proxy, if you're using one) could also " +
     99            "be temporarily offline.  You may want to <b>retry</b>.  " +
     100            "Could not find the following Destination:<BR><BR><div>").getBytes();
     101    /*****
    110102    private final static byte[] ERR_TIMEOUT =
    111         ("HTTP/1.1 504 Gateway Timeout\r\n"+
    112          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    113          "Cache-control: no-cache\r\n\r\n"+
    114          "<html><body><H1>I2P ERROR: TIMEOUT</H1>"+
    115          "That Destination was reachable, but timed out getting a "+
    116          "response.  This is likely a temporary error, so you should simply "+
    117          "try to refresh, though if the problem persists, the remote "+
    118          "destination may have issues.  Could not get a response from "+
    119          "the following Destination:<BR><BR>")
    120         .getBytes();
    121 *****/
    122 
    123     private final static byte[] ERR_NO_OUTPROXY =
    124         ("HTTP/1.1 503 Service Unavailable\r\n"+
    125          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    126          "Cache-control: no-cache\r\n"+
    127          "\r\n"+
    128          "<html><body><H1>I2P ERROR: No outproxy found</H1>"+
    129          "Your request was for a site outside of I2P, but you have no "+
    130          "HTTP outproxy configured.  Please configure an outproxy in I2PTunnel")
    131          .getBytes();
    132 
     103    ("HTTP/1.1 504 Gateway Timeout\r\n"+
     104    "Content-Type: text/html; charset=iso-8859-1\r\n"+
     105    "Cache-control: no-cache\r\n\r\n"+
     106    "<html><body><H1>I2P ERROR: TIMEOUT</H1>"+
     107    "That Destination was reachable, but timed out getting a "+
     108    "response.  This is likely a temporary error, so you should simply "+
     109    "try to refresh, though if the problem persists, the remote "+
     110    "destination may have issues.  Could not get a response from "+
     111    "the following Destination:<BR><BR>")
     112    .getBytes();
     113     *****/
     114    private final static byte[] _ERR_NO_OUTPROXY =
     115                                ("HTTP/1.1 503 Service Unavailable\r\n" +
     116            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     117            "Cache-control: no-cache\r\n" +
     118            "\r\n" +
     119            "<html><body><H1>I2P ERROR: No outproxy found</H1>" +
     120            "Your request was for a site outside of I2P, but you have no " +
     121            "HTTP outproxy configured.  Please configure an outproxy in I2PTunnel").getBytes();
    133122    private final static byte[] ERR_AHELPER_CONFLICT =
    134         ("HTTP/1.1 409 Conflict\r\n"+
    135          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    136          "Cache-control: no-cache\r\n"+
    137          "\r\n"+
    138          "<html><body><H1>I2P ERROR: Destination key conflict</H1>"+
    139          "The addresshelper link you followed specifies a different destination key "+
    140          "than a host entry in your host database. "+
    141          "Someone could be trying to impersonate another eepsite, "+
    142          "or people have given two eepsites identical names.<p>"+
    143          "You can resolve the conflict by considering which key you trust, "+
    144          "and either discarding the addresshelper link, "+
    145          "discarding the host entry from your host database, "+
    146          "or naming one of them differently.<p>")
    147          .getBytes();
    148 
     123                                ("HTTP/1.1 409 Conflict\r\n" +
     124            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     125            "Cache-control: no-cache\r\n" +
     126            "\r\n" +
     127            "<html><body><H1>I2P ERROR: Destination key conflict</H1>" +
     128            "The addresshelper link you followed specifies a different destination key " +
     129            "than a host entry in your host database. " +
     130            "Someone could be trying to impersonate another eepsite, " +
     131            "or people have given two eepsites identical names.<p>" +
     132            "You can resolve the conflict by considering which key you trust, " +
     133            "and either discarding the addresshelper link, " +
     134            "discarding the host entry from your host database, " +
     135            "or naming one of them differently.<p>").getBytes();
    149136    private final static byte[] ERR_AHELPER_NOTFOUND =
    150         ("HTTP/1.1 404 Not Found\r\n"+
    151          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    152          "Cache-control: no-cache\r\n"+
    153          "\r\n"+
    154          "<html><body><H1>I2P ERROR: Helper key not resolvable.</H1>"+
    155          "The helper key you put for i2paddresshelper= is not resolvable. "+
    156          "It seems to be garbage data, or a mistyped b32. Check your URL "+
    157          "to try and fix the helper key to be either a b32 or a base64.")
    158          .getBytes();
    159 
     137                                ("HTTP/1.1 404 Not Found\r\n" +
     138            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     139            "Cache-control: no-cache\r\n" +
     140            "\r\n" +
     141            "<html><body><H1>I2P ERROR: Helper key not resolvable.</H1>" +
     142            "The helper key you put for i2paddresshelper= is not resolvable. " +
     143            "It seems to be garbage data, or a mistyped b32. Check your URL " +
     144            "to try and fix the helper key to be either a b32 or a base64.").getBytes();
    160145    private final static byte[] ERR_AHELPER_NEW =
    161         ("HTTP/1.1 409 New Address\r\n"+
    162          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    163          "Cache-control: no-cache\r\n"+
    164          "\r\n"+
    165          "<html><body><H1>New Host Name with Address Helper</H1>"+
    166          "The address helper link you followed is for a new host name that is not in your address book. " +
    167          "You may either save the destination for this host name to your address book, or remember it only until your router restarts. " +
    168          "If you save it to your address book, you will not see this message again. " +
    169          "If you do not wish to visit this host, click the \"back\" button on your browser.")
    170          .getBytes();
    171 
     146                                ("HTTP/1.1 409 New Address\r\n" +
     147            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     148            "Cache-control: no-cache\r\n" +
     149            "\r\n" +
     150            "<html><body><H1>New Host Name with Address Helper</H1>" +
     151            "The address helper link you followed is for a new host name that is not in your address book. " +
     152            "You may either save the destination for this host name to your address book, or remember it only until your router restarts. " +
     153            "If you save it to your address book, you will not see this message again. " +
     154            "If you do not wish to visit this host, click the \"back\" button on your browser.").getBytes();
    172155    private final static byte[] ERR_BAD_PROTOCOL =
    173         ("HTTP/1.1 403 Bad Protocol\r\n"+
    174          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    175          "Cache-control: no-cache\r\n"+
    176          "\r\n"+
    177          "<html><body><H1>I2P ERROR: NON-HTTP PROTOCOL</H1>"+
    178          "The request uses a bad protocol. "+
    179          "The I2P HTTP Proxy supports http:// requests ONLY. Other protocols such as https:// and ftp:// are not allowed.<BR>")
    180         .getBytes();
    181 
     156                                ("HTTP/1.1 403 Bad Protocol\r\n" +
     157            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     158            "Cache-control: no-cache\r\n" +
     159            "\r\n" +
     160            "<html><body><H1>I2P ERROR: NON-HTTP PROTOCOL</H1>" +
     161            "The request uses a bad protocol. " +
     162            "The I2P HTTP Proxy supports http:// requests ONLY. Other protocols such as https:// and ftp:// are not allowed.<BR>").getBytes();
    182163    private final static byte[] ERR_LOCALHOST =
    183         ("HTTP/1.1 403 Access Denied\r\n"+
    184          "Content-Type: text/html; charset=iso-8859-1\r\n"+
    185          "Cache-control: no-cache\r\n"+
    186          "\r\n"+
    187          "<html><body><H1>I2P ERROR: REQUEST DENIED</H1>"+
    188          "Your browser is misconfigured. Do not use the proxy to access the router console or other localhost destinations.<BR>")
    189         .getBytes();
    190 
     164                                ("HTTP/1.1 403 Access Denied\r\n" +
     165            "Content-Type: text/html; charset=iso-8859-1\r\n" +
     166            "Cache-control: no-cache\r\n" +
     167            "\r\n" +
     168            "<html><body><H1>I2P ERROR: REQUEST DENIED</H1>" +
     169            "Your browser is misconfigured. Do not use the proxy to access the router console or other localhost destinations.<BR>").getBytes();
    191170    private final static byte[] ERR_AUTH =
    192         ("HTTP/1.1 407 Proxy Authentication Required\r\n"+
    193          "Content-Type: text/html; charset=UTF-8\r\n"+
    194          "Cache-control: no-cache\r\n"+
    195          "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.5\r\n" +         // try to get a UTF-8-encoded response back for the password
    196          "Proxy-Authenticate: Basic realm=\"I2P HTTP Proxy\"\r\n" +
    197          "\r\n"+
    198          "<html><body><H1>I2P ERROR: PROXY AUTHENTICATION REQUIRED</H1>"+
    199          "This proxy is configured to require authentication.<BR>")
    200         .getBytes();
     171                                ("HTTP/1.1 407 Proxy Authentication Required\r\n" +
     172            "Content-Type: text/html; charset=UTF-8\r\n" +
     173            "Cache-control: no-cache\r\n" +
     174            "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.5\r\n" + // try to get a UTF-8-encoded response back for the password
     175            "Proxy-Authenticate: Basic realm=\"I2P HTTP Proxy\"\r\n" +
     176            "\r\n" +
     177            "<html><body><H1>I2P ERROR: PROXY AUTHENTICATION REQUIRED</H1>" +
     178            "This proxy is configured to require authentication.<BR>").getBytes();
    201179
    202180    /**
     
    209187        super(localPort, l, sockMgr, tunnel, notifyThis, clientId);
    210188        _proxyNonce = Long.toString(_context.random().nextLong());
    211        // proxyList = new ArrayList();
     189        // proxyList = new ArrayList();
    212190
    213191        setName("HTTP Proxy on " + getTunnel().listenHost + ':' + localPort);
     
    216194        notifyEvent("openHTTPClientResult", "ok");
    217195    }
     196
    218197    /**
    219198     * @throws IllegalArgumentException if the I2PTunnel does not contain
     
    227206
    228207        //proxyList = new ArrayList(); // We won't use outside of i2p
    229         if (waitEventValue("openBaseClientResult").equals("error")) {
     208        if(waitEventValue("openBaseClientResult").equals("error")) {
    230209            notifyEvent("openHTTPClientResult", "error");
    231210            return;
    232211        }
    233212
    234         if (wwwProxy != null) {
     213        if(wwwProxy != null) {
    235214            StringTokenizer tok = new StringTokenizer(wwwProxy, ", ");
    236             while (tok.hasMoreTokens())
     215            while(tok.hasMoreTokens()) {
    237216                _proxyList.add(tok.nextToken().trim());
     217            }
    238218        }
    239219
     
    252232    protected I2PSocketOptions getDefaultOptions() {
    253233        Properties defaultOpts = getTunnel().getClientOptions();
    254         if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
    255             defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, ""+DEFAULT_READ_TIMEOUT);
     234        if(!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT)) {
     235            defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, "" + DEFAULT_READ_TIMEOUT);
     236        }
    256237        //if (!defaultOpts.contains("i2p.streaming.inactivityTimeout"))
    257238        //    defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT);
    258239        I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
    259         if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
     240        if(!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT)) {
    260241            opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
     242        }
    261243        return opts;
    262244    }
     
    270252        Properties defaultOpts = getTunnel().getClientOptions();
    271253        defaultOpts.putAll(overrides);
    272         if (!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT))
    273             defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, ""+DEFAULT_READ_TIMEOUT);
    274         if (!defaultOpts.contains("i2p.streaming.inactivityTimeout"))
    275             defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT);
     254        if(!defaultOpts.contains(I2PSocketOptions.PROP_READ_TIMEOUT)) {
     255            defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, "" + DEFAULT_READ_TIMEOUT);
     256        }
     257        if(!defaultOpts.contains("i2p.streaming.inactivityTimeout")) {
     258            defaultOpts.setProperty("i2p.streaming.inactivityTimeout", "" + DEFAULT_READ_TIMEOUT);
     259        }
    276260        // delayed start
    277261        verifySocketManager();
    278262        I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts);
    279         if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT))
     263        if(!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT)) {
    280264            opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT);
     265        }
    281266        return opts;
    282267    }
    283 
    284268    private InternalSocketRunner isr;
    285269
     
    302286    public boolean close(boolean forced) {
    303287        int reg = _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY);
    304         if (reg == getLocalPort())
     288        if(reg == getLocalPort()) {
    305289            _context.portMapper().unregister(PortMapper.SVC_HTTP_PROXY);
     290        }
    306291        boolean rv = super.close(forced);
    307         if (this.isr != null)
     292        if(this.isr != null) {
    308293            this.isr.stopRunning();
     294        }
    309295        return rv;
    310296    }
    311 
    312297    private static final String HELPER_PARAM = "i2paddresshelper";
    313298    public static final String LOCAL_SERVER = "proxy.i2p";
     
    334319        String currentProxy = null;
    335320        long requestId = ++__requestId;
     321        boolean shout = false;
    336322
    337323        try {
     
    345331            String userAgent = null;
    346332            String authorization = null;
    347             while ((line = reader.readLine(method)) != null) {
     333            while((line = reader.readLine(method)) != null) {
    348334                line = line.trim();
    349                 if (_log.shouldLog(Log.DEBUG))
     335                if(_log.shouldLog(Log.DEBUG)) {
    350336                    _log.debug(getPrefix(requestId) + "Line=[" + line + "]");
     337                }
    351338
    352339                String lowercaseLine = line.toLowerCase(Locale.US);
    353                 if (lowercaseLine.startsWith("connection: ") ||
    354                     lowercaseLine.startsWith("keep-alive: ") ||
    355                     lowercaseLine.startsWith("proxy-connection: "))
     340                if(lowercaseLine.startsWith("connection: ") ||
     341                        lowercaseLine.startsWith("keep-alive: ") ||
     342                        lowercaseLine.startsWith("proxy-connection: ")) {
    356343                    continue;
    357 
    358                 if (method == null) { // first line (GET /base64/realaddr)
    359                     if (_log.shouldLog(Log.DEBUG))
     344                }
     345
     346                if(method == null) { // first line (GET /base64/realaddr)
     347                    if(_log.shouldLog(Log.DEBUG)) {
    360348                        _log.debug(getPrefix(requestId) + "First line [" + line + "]");
     349                    }
    361350
    362351                    String[] params = line.split(" ", 3);
    363                     if (params.length != 3)
     352                    if(params.length != 3) {
    364353                        break;
     354                    }
    365355                    String request = params[1];
    366356
    367357                    // various obscure fixups
    368                     if (request.startsWith("/") && getTunnel().getClientOptions().getProperty("i2ptunnel.noproxy") != null) {
     358                    if(request.startsWith("/") && getTunnel().getClientOptions().getProperty("i2ptunnel.noproxy") != null) {
    369359                        // what is this for ???
    370360                        request = "http://i2p" + request;
    371                     } else if (request.startsWith("/eepproxy/")) {
     361                    } else if(request.startsWith("/eepproxy/")) {
    372362                        // Deprecated
    373363                        // /eepproxy/foo.i2p/bar/baz.html
    374364                        String subRequest = request.substring("/eepproxy/".length());
    375                         if (subRequest.indexOf("/") == -1)
    376                                 subRequest += "/";
     365                        if(subRequest.indexOf("/") == -1) {
     366                            subRequest += "/";
     367                        }
    377368                        request = "http://" + subRequest;
    378                  /****
     369                    /****
    379370                    } else if (request.toLowerCase(Locale.US).startsWith("http://i2p/")) {
    380                         // http://i2p/b64key/bar/baz.html
    381                         // we can't do this now by setting the URI host to the b64key, as
    382                         // it probably contains '=' and '~' which are illegal,
    383                         // and a host may not include escaped octets
    384                         // This will get undone below.
    385                         String subRequest = request.substring("http://i2p/".length());
    386                         if (subRequest.indexOf("/") == -1)
    387                                 subRequest += "/";
    388                          "http://" + "b64key/bar/baz.html"
    389                         request = "http://" + subRequest;
     371                    // http://i2p/b64key/bar/baz.html
     372                    // we can't do this now by setting the URI host to the b64key, as
     373                    // it probably contains '=' and '~' which are illegal,
     374                    // and a host may not include escaped octets
     375                    // This will get undone below.
     376                    String subRequest = request.substring("http://i2p/".length());
     377                    if (subRequest.indexOf("/") == -1)
     378                    subRequest += "/";
     379                    "http://" + "b64key/bar/baz.html"
     380                    request = "http://" + subRequest;
    390381                    } else if (request.toLowerCase(Locale.US).startsWith("http://")) {
    391                         // Unsupported
    392                         // http://$b64key/...
    393                         // This probably used to work, rewrite it so that
    394                         // we can create a URI without illegal characters
    395                         // This will get undone below.
    396                         String  oldPath = request.substring(7);
    397                         int slash = oldPath.indexOf("/");
    398                         if (slash < 0)
    399                             slash = oldPath.length();
    400                         if (slash >= 516 && !oldPath.substring(0, slash).contains("."))
    401                             request = "http://i2p/" + oldPath;
    402                    ****/
     382                    // Unsupported
     383                    // http://$b64key/...
     384                    // This probably used to work, rewrite it so that
     385                    // we can create a URI without illegal characters
     386                    // This will get undone below.
     387                    String  oldPath = request.substring(7);
     388                    int slash = oldPath.indexOf("/");
     389                    if (slash < 0)
     390                    slash = oldPath.length();
     391                    if (slash >= 516 && !oldPath.substring(0, slash).contains("."))
     392                    request = "http://i2p/" + oldPath;
     393                     ****/
    403394                    }
    404395
     
    409400                    try {
    410401                        requestURI = new URI(request);
    411                         if (requestURI.getRawUserInfo() != null || requestURI.getRawFragment() != null) {
     402                        if(requestURI.getRawUserInfo() != null || requestURI.getRawFragment() != null) {
    412403                            // these should never be sent to the proxy in the request line
    413                             if (_log.shouldLog(Log.WARN))
     404                            if(_log.shouldLog(Log.WARN)) {
    414405                                _log.warn(getPrefix(requestId) + "Removing userinfo or fragment [" + request + "]");
     406                            }
    415407                            requestURI = changeURI(requestURI, null, 0, null);
    416408                        }
    417                         if (requestURI.getPath() == null || requestURI.getPath().length() <= 0) {
     409                        if(requestURI.getPath() == null || requestURI.getPath().length() <= 0) {
    418410                            // Add a path
    419                             if (_log.shouldLog(Log.WARN))
     411                            if(_log.shouldLog(Log.WARN)) {
    420412                                _log.warn(getPrefix(requestId) + "Adding / path to [" + request + "]");
     413                            }
    421414                            requestURI = changeURI(requestURI, null, 0, "/");
    422415                        }
    423                     } catch (URISyntaxException use) {
    424                         if (_log.shouldLog(Log.WARN))
     416                    } catch(URISyntaxException use) {
     417                        if(_log.shouldLog(Log.WARN)) {
    425418                            _log.warn(getPrefix(requestId) + "Bad request [" + request + "]", use);
     419                        }
    426420                        break;
    427421                    }
     
    431425                    protocol = requestURI.getScheme();
    432426                    host = requestURI.getHost();
    433                     if (protocol == null || host == null) {
     427                    if(protocol == null || host == null) {
    434428                        _log.warn("Null protocol or host: " + request);
    435429                        method = null;
     
    448442
    449443                    String hostLowerCase = host.toLowerCase(Locale.US);
    450                     if (hostLowerCase.equals(LOCAL_SERVER)) {
     444                    if(hostLowerCase.equals(LOCAL_SERVER)) {
    451445                        // so we don't do any naming service lookups
    452446                        destination = host;
     
    454448                        internalPath = requestURI.getPath();
    455449                        internalRawQuery = requestURI.getRawQuery();
    456                     } else if (hostLowerCase.equals("i2p")) {
    457                         // pull the b64 dest out of the first path element
     450                    } else if(hostLowerCase.equals("i2p")) {
     451                        // pull the b64 _dest out of the first path element
    458452                        String oldPath = requestURI.getPath().substring(1);
    459453                        int slash = oldPath.indexOf("/");
    460                         if (slash < 0) {
     454                        if(slash < 0) {
    461455                            slash = oldPath.length();
    462456                            oldPath += "/";
    463457                        }
    464                         String dest = oldPath.substring(0, slash);
    465                         if (slash >= 516 && !dest.contains(".")) {
     458                        String _dest = oldPath.substring(0, slash);
     459                        if(slash >= 516 && !_dest.contains(".")) {
    466460                            // possible alternative:
    467461                            // redirect to b32
    468                             destination = dest;
     462                            destination = _dest;
    469463                            host = getHostName(destination);
    470464                            targetRequest = requestURI.toASCIIString();
    471465                            String newURI = oldPath.substring(slash);
    472466                            String query = requestURI.getRawQuery();
    473                             if (query != null)
     467                            if(query != null) {
    474468                                newURI += '?' + query;
     469                            }
    475470                            try {
    476471                                requestURI = new URI(newURI);
    477                             } catch (URISyntaxException use) {
     472                            } catch(URISyntaxException use) {
    478473                                // shouldnt happen
    479474                                _log.warn(request, use);
     
    486481                            break;
    487482                        }
    488                     } else if (hostLowerCase.endsWith(".i2p")) {
     483                    } else if(hostLowerCase.endsWith(".i2p")) {
    489484                        // Destination gets the host name
    490485                        destination = host;
     
    492487                        host = getHostName(destination);
    493488
    494                         if (requestURI.getPort() >= 0) {
     489                        if(requestURI.getPort() >= 0) {
    495490                            // TODO support I2P ports someday
    496491                            //if (port >= 0)
    497492                            //    host = host + ':' + port;
    498                             if (_log.shouldLog(Log.WARN))
     493                            if(_log.shouldLog(Log.WARN)) {
    499494                                _log.warn(getPrefix(requestId) + "Removing port from [" + request + "]");
     495                            }
    500496                            try {
    501497                                requestURI = changeURI(requestURI, null, -1, null);
    502                             } catch (URISyntaxException use) {
     498                            } catch(URISyntaxException use) {
    503499                                _log.warn(request, use);
    504500                                method = null;
     
    508504
    509505                        String query = requestURI.getRawQuery();
    510                         if (query != null) {
     506                        if(query != null) {
    511507                            boolean ahelperConflict = false;
    512508
    513509                            // Try to find an address helper in the query
    514510                            String[] helperStrings = removeHelper(query);
    515                             if (helperStrings != null &&
    516                                 !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
     511                            if(helperStrings != null &&
     512                                    !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
    517513                                query = helperStrings[0];
    518                                 if (query.equals(""))
     514                                if(query.equals("")) {
    519515                                    query = null;
     516                                }
    520517                                try {
    521518                                    requestURI = replaceQuery(requestURI, query);
    522                                 } catch (URISyntaxException use) {
     519                                } catch(URISyntaxException use) {
    523520                                    // shouldn't happen
    524521                                    _log.warn(request, use);
     
    528525                                ahelperKey = helperStrings[1];
    529526                                // Key contains data, lets not ignore it
    530                                 if (ahelperKey.length() > 0) {
     527                                if(ahelperKey.length() > 0) {
    531528                                    if(ahelperKey.endsWith(".i2p")) {
    532529                                        // allow i2paddresshelper=<b32>.b32.i2p syntax.
    533530                                        /*
    534                                           also i2paddresshelper=name.i2p for aliases
    535                                           i.e. on your eepsite put
    536                                           <a href="?i2paddresshelper=name.i2p">This is the name I want to be called.</a>
    537                                         */
    538                                         Destination dest = _context.namingService().lookup(ahelperKey);
    539                                         if(dest==null) {
    540                                             if (_log.shouldLog(Log.WARN))
    541                                                 _log.warn(getPrefix(requestId) + "Could not find destination for "+ahelperKey);
     531                                        also i2paddresshelper=name.i2p for aliases
     532                                        i.e. on your eepsite put
     533                                        <a href="?i2paddresshelper=name.i2p">This is the name I want to be called.</a>
     534                                         */
     535                                        Destination _dest = _context.namingService().lookup(ahelperKey);
     536                                        if(_dest == null) {
     537                                            if(_log.shouldLog(Log.WARN)) {
     538                                                _log.warn(getPrefix(requestId) + "Could not find destination for " + ahelperKey);
     539                                            }
    542540                                            byte[] header = getErrorPage("ahelper-notfound", ERR_AHELPER_NOTFOUND);
    543541                                            out.write(header);
     
    548546                                            return;
    549547                                        }
    550                                         ahelperKey = dest.toBase64();
    551                                     } 
     548                                        ahelperKey = _dest.toBase64();
     549                                    }
    552550
    553551                                    ahelperPresent = true;
    554552                                    // ahelperKey will be validated later
    555                                     if (host == null || "i2p".equals(host)) {
     553                                    if(host == null || "i2p".equals(host)) {
    556554                                        // Host lookup failed - resolvable only with addresshelper
    557555                                        // Store in local HashMap unless there is conflict
    558556                                        String old = addressHelpers.putIfAbsent(destination.toLowerCase(Locale.US), ahelperKey);
    559557                                        ahelperNew = old == null;
    560                                         if ((!ahelperNew) && !old.equals(ahelperKey)) {
     558                                        if((!ahelperNew) && !old.equals(ahelperKey)) {
    561559                                            // Conflict: handle when URL reconstruction done
    562560                                            ahelperConflict = true;
    563                                             if (_log.shouldLog(Log.WARN))
     561                                            if(_log.shouldLog(Log.WARN)) {
    564562                                                _log.warn(getPrefix(requestId) + "Addresshelper key conflict for site [" + destination +
    565                                                           "], trusted key [" + old + "], specified key [" + ahelperKey + "].");
     563                                                        "], trusted key [" + old + "], specified key [" + ahelperKey + "].");
     564                                            }
    566565                                        }
    567566                                    } else {
     
    569568                                        // Silently bypass correct keys, otherwise alert
    570569                                        Destination hostDest = _context.namingService().lookup(destination);
    571                                         if (hostDest != null) {
     570                                        if(hostDest != null) {
    572571                                            String destB64 = hostDest.toBase64();
    573                                             if (destB64 != null && !destB64.equals(ahelperKey)) {
     572                                            if(destB64 != null && !destB64.equals(ahelperKey)) {
    574573                                                // Conflict: handle when URL reconstruction done
    575574                                                ahelperConflict = true;
    576                                                 if (_log.shouldLog(Log.WARN))
     575                                                if(_log.shouldLog(Log.WARN)) {
    577576                                                    _log.warn(getPrefix(requestId) + "Addresshelper key conflict for site [" + destination +
    578                                                               "], trusted key [" + destB64 + "], specified key [" + ahelperKey + "].");
    579                                                
     577                                                            "], trusted key [" + destB64 + "], specified key [" + ahelperKey + "].");
     578                                                }
     579
    580580                                            }
    581581                                        }
     
    585585
    586586                            // Did addresshelper key conflict?
    587                             if (ahelperConflict) {
    588                                 if (out != null) {
     587                            if(ahelperConflict) {
     588                                if(out != null) {
    589589                                    // convert ahelperKey to b32
    590590                                    String alias = getHostName(ahelperKey);
    591                                     if (alias.equals("i2p")) {
     591                                    if(alias.equals("i2p")) {
    592592                                        // bad ahelperKey
    593593                                        byte[] header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
     
    598598                                        try {
    599599                                            conflictURI = changeURI(requestURI, alias, 0, null);
    600                                         } catch (URISyntaxException use) {
     600                                        } catch(URISyntaxException use) {
    601601                                            // shouldn't happen
    602602                                            _log.warn(request, use);
     
    618618
    619619                        String addressHelper = addressHelpers.get(destination);
    620                         if (addressHelper != null)
     620                        if(addressHelper != null) {
    621621                            host = getHostName(addressHelper);
     622                        }
    622623
    623624                        // now strip everything but path and query from URI
    624625                        targetRequest = requestURI.toASCIIString();
    625626                        String newURI = requestURI.getRawPath();
    626                         if (query != null)
     627                        if(query != null) {
    627628                            newURI += '?' + query;
     629                        }
    628630                        try {
    629631                            requestURI = new URI(newURI);
    630                         } catch (URISyntaxException use) {
     632                        } catch(URISyntaxException use) {
    631633                            // shouldnt happen
    632634                            _log.warn(request, use);
     
    635637                        }
    636638
    637                         // end of (host endsWith(".i2p"))
    638 
    639                     } else if (hostLowerCase.equals("localhost") || host.equals("127.0.0.1") ||
    640                                host.startsWith("192.168.") || host.equals("[::1]")) {
     639                    // end of (host endsWith(".i2p"))
     640
     641                    } else if(hostLowerCase.equals("localhost") || host.equals("127.0.0.1") ||
     642                            host.startsWith("192.168.") || host.equals("[::1]")) {
    641643                        // if somebody is trying to get to 192.168.example.com, oh well
    642                         if (out != null) {
     644                        if(out != null) {
    643645                            out.write(getErrorPage("localhost", ERR_LOCALHOST));
    644646                            writeFooter(out);
     
    646648                        s.close();
    647649                        return;
    648                     } else if (host.contains(".") || host.startsWith("[")) {
    649                         if (port >= 0)
     650                    } else if(host.contains(".") || host.startsWith("[")) {
     651                        if(port >= 0) {
    650652                            host = host + ':' + port;
     653                        }
    651654                        // The request must be forwarded to a WWW proxy
    652                         if (_log.shouldLog(Log.DEBUG))
     655                        if(_log.shouldLog(Log.DEBUG)) {
    653656                            _log.debug("Before selecting outproxy for " + host);
     657                        }
    654658                        currentProxy = selectProxy();
    655                         if (_log.shouldLog(Log.DEBUG))
     659                        if(_log.shouldLog(Log.DEBUG)) {
    656660                            _log.debug("After selecting outproxy for " + host + ": " + currentProxy);
    657                         if (currentProxy == null) {
    658                             if (_log.shouldLog(Log.WARN))
     661                        }
     662                        if(currentProxy == null) {
     663                            if(_log.shouldLog(Log.WARN)) {
    659664                                _log.warn(getPrefix(requestId) + "Host wants to be outproxied, but we dont have any!");
     665                            }
    660666                            l.log("No HTTP outproxy found for the request.");
    661                             if (out != null) {
    662                                 out.write(getErrorPage("noproxy", ERR_NO_OUTPROXY));
     667                            if(out != null) {
     668                                out.write(getErrorPage("noproxy", _ERR_NO_OUTPROXY));
    663669                                writeFooter(out);
    664670                            }
     
    669675                        usingWWWProxy = true;
    670676                        targetRequest = requestURI.toASCIIString();
    671                         if (_log.shouldLog(Log.DEBUG))
    672                             _log.debug(getPrefix(requestId) +  " [" + host + "]: wwwProxy!");
     677                        if(_log.shouldLog(Log.DEBUG)) {
     678                            _log.debug(getPrefix(requestId) + " [" + host + "]: wwwProxy!");
     679                        }
    673680                    } else {
    674681                        // what is left for here? a hostname with no dots, and != "i2p"
     
    676683                        // Perhaps something in privatehosts.txt ...
    677684                        // Rather than look it up, just bail out.
    678                         if (_log.shouldLog(Log.WARN))
     685                        if(_log.shouldLog(Log.WARN)) {
    679686                            _log.warn("NODOTS, NOI2P: " + request);
    680                         if (out != null) {
     687                        }
     688                        if(out != null) {
    681689                            out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
    682690                            writeFooter(out);
     
    687695
    688696                    boolean isValid = usingWWWProxy || usingInternalServer || isSupportedAddress(host, protocol);
    689                     if (!isValid) {
    690                         if (_log.shouldLog(Log.INFO)) _log.info(getPrefix(requestId) + "notValid(" + host + ")");
     697                    if(!isValid) {
     698                        if(_log.shouldLog(Log.INFO)) {
     699                            _log.info(getPrefix(requestId) + "notValid(" + host + ")");
     700                        }
    691701                        method = null;
    692702                        destination = null;
     
    696706                    line = method + ' ' + requestURI.toASCIIString() + ' ' + protocolVersion;
    697707
    698                     if (_log.shouldLog(Log.DEBUG)) {
     708                    if(_log.shouldLog(Log.DEBUG)) {
    699709                        _log.debug(getPrefix(requestId) + "NEWREQ: \"" + line + "\"");
    700710                        _log.debug(getPrefix(requestId) + "HOST  : \"" + host + "\"");
     
    702712                    }
    703713
    704                     // end first line processing
     714                // end first line processing
    705715
    706716                } else {
    707                     if (lowercaseLine.startsWith("host: ") && !usingWWWProxy) {
     717                    if(lowercaseLine.startsWith("host: ") && !usingWWWProxy) {
    708718                        // Note that we only pass the original Host: line through to the outproxy
    709719                        // But we don't create a Host: line if it wasn't sent to us
    710720                        line = "Host: " + host;
    711                         if (_log.shouldLog(Log.INFO))
     721                        if(_log.shouldLog(Log.INFO)) {
    712722                            _log.info(getPrefix(requestId) + "Setting host = " + host);
    713                     } else if (lowercaseLine.startsWith("user-agent: ")) {
     723                        }
     724                    } else if(lowercaseLine.startsWith("user-agent: ")) {
    714725                        // save for deciding whether to offer address book form
    715726                        userAgent = lowercaseLine.substring(12);
    716                         if (!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
     727                        if(!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
    717728                            line = null;
    718729                            continue;
    719730                        }
    720                     } else if (lowercaseLine.startsWith("accept")) {
     731                    } else if(lowercaseLine.startsWith("accept")) {
    721732                        // strip the accept-blah headers, as they vary dramatically from
    722733                        // browser to browser
    723734                        line = null;
    724735                        continue;
    725                     } else if (lowercaseLine.startsWith("referer: ") &&
    726                                !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_REFERER)).booleanValue()) {
     736                    } else if(lowercaseLine.startsWith("referer: ") &&
     737                            !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_REFERER)).booleanValue()) {
    727738                        // Shouldn't we be more specific, like accepting in-site referers ?
    728739                        //line = "Referer: i2p";
    729740                        line = null;
    730741                        continue; // completely strip the line
    731                     } else if (lowercaseLine.startsWith("via: ") &&
    732                                !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_VIA)).booleanValue()) {
     742                    } else if(lowercaseLine.startsWith("via: ") &&
     743                            !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_VIA)).booleanValue()) {
    733744                        //line = "Via: i2p";
    734745                        line = null;
    735746                        continue; // completely strip the line
    736                     } else if (lowercaseLine.startsWith("from: ")) {
     747                    } else if(lowercaseLine.startsWith("from: ")) {
    737748                        //line = "From: i2p";
    738749                        line = null;
    739750                        continue; // completely strip the line
    740                     } else if (lowercaseLine.startsWith("authorization: ntlm ")) {
     751                    } else if(lowercaseLine.startsWith("authorization: ntlm ")) {
    741752                        // Block Windows NTLM after 401
    742753                        line = null;
    743754                        continue;
    744                     } else if (lowercaseLine.startsWith("proxy-authorization: ")) {
     755                    } else if(lowercaseLine.startsWith("proxy-authorization: ")) {
    745756                        // This should be for us. It is a
    746757                        // hop-by-hop header, and we definitely want to block Windows NTLM after a far-end 407.
    747758                        // Response to far-end shouldn't happen, as we
    748759                        // strip Proxy-Authenticate from the response in HTTPResponseOutputStream
    749                         if (lowercaseLine.startsWith("proxy-authorization: basic "))
    750                             // save for auth check below
     760                        if(lowercaseLine.startsWith("proxy-authorization: basic ")) // save for auth check below
     761                        {
    751762                            authorization = line.substring(27);  // "proxy-authorization: basic ".length()
     763                        }
    752764                        line = null;
    753765                        continue;
    754                     }
    755                 }
    756 
    757                 if (line.length() == 0) {
     766                    } else if(lowercaseLine.startsWith("icy")) {
     767                        // icecast/shoutcast, We need to leave the user-agent alone.
     768                        shout = true;
     769                    }
     770                }
     771
     772                if(line.length() == 0) {
    758773                    // No more headers, add our own and break out of the loop
    759774                    String ok = getTunnel().getClientOptions().getProperty("i2ptunnel.gzip");
    760775                    boolean gzip = DEFAULT_GZIP;
    761                     if (ok != null)
     776                    if(ok != null) {
    762777                        gzip = Boolean.valueOf(ok).booleanValue();
    763                     if (gzip && !usingInternalServer) {
     778                    }
     779                    if(gzip && !usingInternalServer) {
    764780                        // according to rfc2616 s14.3, this *should* force identity, even if
    765781                        // an explicit q=0 for gzip doesn't.  tested against orion.i2p, and it
     
    768784                        newRequest.append("X-Accept-Encoding: x-i2p-gzip;q=1.0, identity;q=0.5, deflate;q=0, gzip;q=0, *;q=0\r\n");
    769785                    }
    770                     if (!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
    771                         // let's not advertise to external sites that we are from I2P
    772                         if (usingWWWProxy)
    773                             newRequest.append("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6\r\n");
    774                         else
    775                             newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n");
     786                    if(!shout) {
     787                        if(!Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_USER_AGENT)).booleanValue()) {
     788                            // let's not advertise to external sites that we are from I2P
     789                            if(usingWWWProxy) {
     790                                newRequest.append("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6\r\n");
     791                            } else {
     792                                newRequest.append("User-Agent: MYOB/6.66 (AN/ON)\r\n");
     793                            }
     794                        }
    776795                    }
    777796                    // Add Proxy-Authentication header for next hop (outproxy)
    778                     if (usingWWWProxy && Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH)).booleanValue()) {
     797                    if(usingWWWProxy && Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_AUTH)).booleanValue()) {
    779798                        // specific for this proxy
    780799                        String user = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_USER_PREFIX + currentProxy);
    781800                        String pw = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_PW_PREFIX + currentProxy);
    782                         if (user == null || pw == null) {
     801                        if(user == null || pw == null) {
    783802                            // if not, look at default user and pw
    784803                            user = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_USER);
    785804                            pw = getTunnel().getClientOptions().getProperty(PROP_OUTPROXY_PW);
    786805                        }
    787                         if (user != null && pw != null) {
    788                             newRequest.append("Proxy-Authorization: Basic ")
    789                                       .append(Base64.encode((user + ':' + pw).getBytes(), true))    // true = use standard alphabet
    790                                       .append("\r\n");
    791                         }
    792                     }
    793                     newRequest.append("Connection: close\r\n\r\n");
     806                        if(user != null && pw != null) {
     807                            newRequest.append("Proxy-Authorization: Basic ").append(Base64.encode((user + ':' + pw).getBytes(), true)) // true = use standard alphabet
     808                                    .append("\r\n");
     809                        }
     810                    }
     811                    newRequest.append("Connection: close\r\n\r\n");
    794812                    break;
    795813                } else {
     
    798816            } // end header processing
    799817
    800             if (_log.shouldLog(Log.DEBUG))
     818            if(_log.shouldLog(Log.DEBUG)) {
    801819                _log.debug(getPrefix(requestId) + "NewRequest header: [" + newRequest.toString() + "]");
    802 
    803             if (method == null || destination == null) {
     820            }
     821
     822            if(method == null || destination == null) {
    804823                //l.log("No HTTP method found in the request.");
    805                 if (out != null) {
    806                     if (protocol != null && "http".equals(protocol.toLowerCase(Locale.US)))
     824                if(out != null) {
     825                    if(protocol != null && "http".equals(protocol.toLowerCase(Locale.US))) {
    807826                        out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
    808                     else
     827                    } else {
    809828                        out.write(getErrorPage("protocol", ERR_BAD_PROTOCOL));
     829                    }
    810830                    writeFooter(out);
    811831                }
     
    814834            }
    815835
    816             if (_log.shouldLog(Log.DEBUG))
     836            if(_log.shouldLog(Log.DEBUG)) {
    817837                _log.debug(getPrefix(requestId) + "Destination: " + destination);
     838            }
    818839
    819840            // Authorization
    820             if (!authorize(s, requestId, authorization)) {
    821                 if (_log.shouldLog(Log.WARN)) {
    822                     if (authorization != null)
     841            if(!authorize(s, requestId, authorization)) {
     842                if(_log.shouldLog(Log.WARN)) {
     843                    if(authorization != null) {
    823844                        _log.warn(getPrefix(requestId) + "Auth failed, sending 407 again");
    824                     else
     845                    } else {
    825846                        _log.warn(getPrefix(requestId) + "Auth required, sending 407");
     847                    }
    826848                }
    827849                out.write(getErrorPage("auth", ERR_AUTH));
     
    833855            // Serve local proxy files (images, css linked from error pages)
    834856            // Ignore all the headers
    835             if (usingInternalServer) {
     857            if(usingInternalServer) {
    836858                // disable the add form if address helper is disabled
    837                 if (internalPath.equals("/add") &&
    838                     Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
     859                if(internalPath.equals("/add") &&
     860                        Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
    839861                    out.write(ERR_HELPER_DISABLED);
    840862                } else {
     
    851873            Destination clientDest = null;
    852874            String addressHelper = addressHelpers.get(destination.toLowerCase(Locale.US));
    853             if (addressHelper != null) {
     875            if(addressHelper != null) {
    854876                clientDest = _context.namingService().lookup(addressHelper);
    855                 if (clientDest == null) {
     877                if(clientDest == null) {
    856878                    // remove bad entries
    857879                    addressHelpers.remove(destination.toLowerCase(Locale.US));
    858                     if (_log.shouldLog(Log.WARN))
     880                    if(_log.shouldLog(Log.WARN)) {
    859881                        _log.warn(getPrefix(requestId) + "Could not find destination for " + addressHelper);
     882                    }
    860883                    byte[] header = getErrorPage("ahelper-notfound", ERR_AHELPER_NOTFOUND);
    861884                    writeErrorMessage(header, out, targetRequest, false, destination, null);
     
    863886                    return;
    864887                }
    865             } else if ("i2p".equals(host)) {
     888            } else if("i2p".equals(host)) {
    866889                clientDest = null;
    867             } else if (destination.length() == 60 && destination.toLowerCase(Locale.US).endsWith(".b32.i2p")) {
     890            } else if(destination.length() == 60 && destination.toLowerCase(Locale.US).endsWith(".b32.i2p")) {
    868891                // use existing session to look up for efficiency
    869892                verifySocketManager();
    870893                I2PSession sess = sockMgr.getSession();
    871                 if (sess != null && !sess.isClosed()) {
     894                if(sess != null && !sess.isClosed()) {
    872895                    byte[] hData = Base32.decode(destination.substring(0, 52));
    873                     if (hData != null) {
    874                         if (_log.shouldLog(Log.INFO))
     896                    if(hData != null) {
     897                        if(_log.shouldLog(Log.INFO)) {
    875898                            _log.info("lookup in-session " + destination);
     899                        }
    876900                        Hash hash = Hash.create(hData);
    877                         clientDest = sess.lookupDest(hash, 20*1000);
     901                        clientDest = sess.lookupDest(hash, 20 * 1000);
    878902                    }
    879903                } else {
     
    884908            }
    885909
    886             if (clientDest == null) {
     910            if(clientDest == null) {
    887911                //l.log("Could not resolve " + destination + ".");
    888                 if (_log.shouldLog(Log.WARN))
     912                if(_log.shouldLog(Log.WARN)) {
    889913                    _log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
     914                }
    890915                byte[] header;
    891916                String jumpServers = null;
    892                 if (usingWWWProxy)
     917                if(usingWWWProxy) {
    893918                    header = getErrorPage("dnfp", ERR_DESTINATION_UNKNOWN);
    894                 else if (ahelperPresent)
     919                } else if(ahelperPresent) {
    895920                    header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
    896                 else if (destination.length() == 60 && destination.toLowerCase(Locale.US).endsWith(".b32.i2p"))
     921                } else if(destination.length() == 60 && destination.toLowerCase(Locale.US).endsWith(".b32.i2p")) {
    897922                    header = getErrorPage("dnf", ERR_DESTINATION_UNKNOWN);
    898                 else {
     923                } else {
    899924                    header = getErrorPage("dnfh", ERR_DESTINATION_UNKNOWN);
    900925                    jumpServers = getTunnel().getClientOptions().getProperty(PROP_JUMP_SERVERS);
    901                     if (jumpServers == null)
     926                    if(jumpServers == null) {
    902927                        jumpServers = DEFAULT_JUMP_SERVERS;
     928                    }
    903929                }
    904930                writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, jumpServers);
     
    910936            // This will only load once - the second time it won't be "new"
    911937            // Don't do this for eepget, which uses a user-agent of "Wget"
    912             if (ahelperNew && "GET".equals(method) &&
    913                 (userAgent == null || !userAgent.startsWith("Wget")) &&
    914                 !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
     938            if(ahelperNew && "GET".equals(method) &&
     939                    (userAgent == null || !userAgent.startsWith("Wget")) &&
     940                    !Boolean.valueOf(getTunnel().getClientOptions().getProperty(PROP_DISABLE_HELPER)).booleanValue()) {
    915941                writeHelperSaveForm(out, destination, ahelperKey, targetRequest);
    916942                s.close();
     
    922948            // This also prevents the not-found error page from looking bad
    923949            // Syndie can't handle a redirect of a POST
    924             if (ahelperPresent && !"POST".equals(method)) {
     950            if(ahelperPresent && !"POST".equals(method)) {
    925951                String uri = targetRequest;
    926                 if (_log.shouldLog(Log.DEBUG))
     952                if(_log.shouldLog(Log.DEBUG)) {
    927953                    _log.debug("Auto redirecting to " + uri);
    928                 out.write(("HTTP/1.1 301 Address Helper Accepted\r\n"+
    929                           "Location: " + uri + "\r\n"+
    930                           "\r\n").getBytes("UTF-8"));
     954                }
     955                out.write(("HTTP/1.1 301 Address Helper Accepted\r\n" +
     956                        "Location: " + uri + "\r\n" +
     957                        "\r\n").getBytes("UTF-8"));
    931958                s.close();
    932959                return;
     
    943970            new I2PTunnelHTTPClientRunner(s, i2ps, sockLock, data, mySockets, onTimeout);
    944971        } catch (SocketException ex) {
    945             if (_log.shouldLog(Log.INFO))
     972            if (_log.shouldLog(Log.INFO)) {
    946973                _log.info(getPrefix(requestId) + "Error trying to connect", ex);
     974            }
    947975            //l.log("Error connecting: " + ex.getMessage());
    948976            handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
    949977            closeSocket(s);
    950         } catch (IOException ex) {
    951             if (_log.shouldLog(Log.INFO))
     978        } catch(IOException ex) {
     979            if(_log.shouldLog(Log.INFO)) {
    952980                _log.info(getPrefix(requestId) + "Error trying to connect", ex);
     981            }
    953982            //l.log("Error connecting: " + ex.getMessage());
    954983            handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
    955984            closeSocket(s);
    956         } catch (I2PException ex) {
    957             if (_log.shouldLog(Log.INFO))
     985        } catch(I2PException ex) {
     986            if(_log.shouldLog(Log.INFO)) {
    958987                _log.info("getPrefix(requestId) + Error trying to connect", ex);
     988            }
    959989            //l.log("Error connecting: " + ex.getMessage());
    960990            handleHTTPClientException(ex, out, targetRequest, usingWWWProxy, currentProxy, requestId);
    961991            closeSocket(s);
    962         } catch (OutOfMemoryError oom) {
     992        } catch(OutOfMemoryError oom) {
    963993            IOException ex = new IOException("OOM");
    964994            _log.error("getPrefix(requestId) + Error trying to connect", oom);
     
    9711001    /** @since 0.8.7 */
    9721002    private void writeHelperSaveForm(OutputStream out, String destination, String ahelperKey, String targetRequest) throws IOException {
    973         if (out == null)
     1003        if(out == null) {
    9741004            return;
     1005        }
    9751006        byte[] header = getErrorPage("ahelper-new", ERR_AHELPER_NEW);
    9761007        out.write(header);
    9771008        out.write(("<table><tr><td class=\"mediumtags\" align=\"right\">" + _("Host") +
    978                    "</td><td class=\"mediumtags\">" + destination + "</td></tr>\n").getBytes());
     1009                "</td><td class=\"mediumtags\">" + destination + "</td></tr>\n").getBytes());
    9791010        try {
    9801011            String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData());
    9811012            out.write(("<tr><td class=\"mediumtags\" align=\"right\">" + _("Base 32") + "</td>" +
    982                        "<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>").getBytes());
    983         } catch (Exception e) {}
     1013                    "<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>").getBytes());
     1014        } catch(Exception e) {
     1015        }
    9841016        out.write(("<tr><td class=\"mediumtags\" align=\"right\">" + _("Destination") + "</td><td>" +
    985                    "<textarea rows=\"1\" style=\"height: 4em; min-width: 0; min-height: 0;\" cols=\"70\" wrap=\"off\" readonly=\"readonly\" >" +
    986                    ahelperKey + "</textarea></td></tr></table>\n" +
    987                    "<hr><div class=\"formaction\">"+
    988                    // FIXME if there is a query remaining it is lost
    989                    "<form method=\"GET\" action=\"" + targetRequest + "\">" +
    990                    "<button type=\"submit\" class=\"go\">" + _("Continue to {0} without saving", destination) + "</button>" +
    991                    "</form>\n<form method=\"GET\" action=\"http://" + LOCAL_SERVER + "/add\">" +
    992                    "<input type=\"hidden\" name=\"host\" value=\"" + destination + "\">\n" +
    993                    "<input type=\"hidden\" name=\"dest\" value=\"" + ahelperKey + "\">\n" +
    994                    "<input type=\"hidden\" name=\"nonce\" value=\"" + _proxyNonce + "\">\n" +
    995                    "<button type=\"submit\" class=\"accept\" name=\"router\" value=\"router\">" + _("Save {0} to router address book and continue to eepsite", destination) + "</button><br>\n").getBytes("UTF-8"));
    996         if (_context.namingService().getName().equals("BlockfileNamingService")) {
     1017                "<textarea rows=\"1\" style=\"height: 4em; min-width: 0; min-height: 0;\" cols=\"70\" wrap=\"off\" readonly=\"readonly\" >" +
     1018                ahelperKey + "</textarea></td></tr></table>\n" +
     1019                "<hr><div class=\"formaction\">" +
     1020                // FIXME if there is a query remaining it is lost
     1021                "<form method=\"GET\" action=\"" + targetRequest + "\">" +
     1022                "<button type=\"submit\" class=\"go\">" + _("Continue to {0} without saving", destination) + "</button>" +
     1023                "</form>\n<form method=\"GET\" action=\"http://" + LOCAL_SERVER + "/add\">" +
     1024                "<input type=\"hidden\" name=\"host\" value=\"" + destination + "\">\n" +
     1025                "<input type=\"hidden\" name=\"dest\" value=\"" + ahelperKey + "\">\n" +
     1026                "<input type=\"hidden\" name=\"nonce\" value=\"" + _proxyNonce + "\">\n" +
     1027                "<button type=\"submit\" class=\"accept\" name=\"router\" value=\"router\">" + _("Save {0} to router address book and continue to eepsite", destination) + "</button><br>\n").getBytes("UTF-8"));
     1028        if(_context.namingService().getName().equals("BlockfileNamingService")) {
    9971029            // only blockfile supports multiple books
    9981030            out.write(("<br><button type=\"submit\" name=\"master\" value=\"master\">" + _("Save {0} to master address book and continue to eepsite", destination) + "</button><br>\n").getBytes("UTF-8"));
     
    10001032        }
    10011033        out.write(("<input type=\"hidden\" name=\"url\" value=\"" + targetRequest + "\">\n" +
    1002                    "</form></div></div>").getBytes());
     1034                "</form></div></div>").getBytes());
    10031035        writeFooter(out);
    10041036    }
     
    10161048    private static class InputReader {
    10171049        InputStream _s;
     1050
    10181051        public InputReader(InputStream s) {
    10191052            _s = s;
    10201053        }
     1054
    10211055        String readLine(String method) throws IOException {
    1022              //  Use unbuffered until we can find a BufferedReader that limits line length
    1023              //if (method == null || "POST".equals(method))
    1024                  return DataHelper.readLine(_s);
    1025              //if (_br == null)
    1026              //    _br = new BufferedReader(new InputStreamReader(_s, "ISO-8859-1"));
    1027              //return _br.readLine();
     1056            //  Use unbuffered until we can find a BufferedReader that limits line length
     1057            //if (method == null || "POST".equals(method))
     1058            return DataHelper.readLine(_s);
     1059        //if (_br == null)
     1060        //    _br = new BufferedReader(new InputStreamReader(_s, "ISO-8859-1"));
     1061        //return _br.readLine();
    10281062        }
    10291063    }
     
    10341068     */
    10351069    private final String getHostName(String host) {
    1036         if (host == null) return null;
    1037         if (host.length() == 60 && host.toLowerCase(Locale.US).endsWith(".b32.i2p"))
     1070        if(host == null) {
     1071            return null;
     1072        }
     1073        if(host.length() == 60 && host.toLowerCase(Locale.US).endsWith(".b32.i2p")) {
    10381074            return host;
    1039         Destination dest = _context.namingService().lookup(host);
    1040         if (dest == null) return "i2p";
    1041         return Base32.encode(dest.calculateHash().getData()) + ".b32.i2p";
     1075        }
     1076        Destination _dest = _context.namingService().lookup(host);
     1077        if(_dest == null) {
     1078            return "i2p";
     1079        }
     1080        return Base32.encode(_dest.calculateHash().getData()) + ".b32.i2p";
    10421081    }
    10431082
     
    10571096
    10581097    private static byte[] getErrorPage(I2PAppContext ctx, String base, byte[] backup) {
    1059          File errorDir = new File(ctx.getBaseDir(), "docs");
    1060          String lang = ctx.getProperty("routerconsole.lang", Locale.getDefault().getLanguage());
    1061          if (lang != null && lang.length() > 0 && !lang.equals("en")) {
    1062              File file = new File(errorDir, base + "-header_" + lang + ".ht");
    1063              try {
    1064                  return readFile(file);
    1065              } catch (IOException ioe) {
    1066                  // try the english version now
    1067              }
    1068          }
    1069          File file = new File(errorDir, base + "-header.ht");
    1070          try {
    1071              return readFile(file);
    1072          } catch (IOException ioe) {
    1073              return backup;
    1074          }
     1098        File errorDir = new File(ctx.getBaseDir(), "docs");
     1099        String lang = ctx.getProperty("routerconsole.lang", Locale.getDefault().getLanguage());
     1100        if(lang != null && lang.length() > 0 && !lang.equals("en")) {
     1101            File file = new File(errorDir, base + "-header_" + lang + ".ht");
     1102            try {
     1103                return readFile(file);
     1104            } catch(IOException ioe) {
     1105                // try the english version now
     1106            }
     1107        }
     1108        File file = new File(errorDir, base + "-header.ht");
     1109        try {
     1110            return readFile(file);
     1111        } catch(IOException ioe) {
     1112            return backup;
     1113        }
    10751114    }
    10761115
    10771116    private static byte[] readFile(File file) throws IOException {
    1078          FileInputStream fis = null;
    1079          byte[] buf = new byte[512];
    1080          ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
    1081          try {
    1082              int len = 0;
    1083              fis = new FileInputStream(file);
    1084              while ((len = fis.read(buf)) > 0) {
    1085                  baos.write(buf, 0, len);
    1086              }
    1087              return baos.toByteArray();
    1088          } finally {
    1089              try { if (fis != null) fis.close(); } catch (IOException foo) {}
    1090          }
    1091          // we won't ever get here
     1117        FileInputStream fis = null;
     1118        byte[] buf = new byte[512];
     1119        ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
     1120        try {
     1121            int len = 0;
     1122            fis = new FileInputStream(file);
     1123            while((len = fis.read(buf)) > 0) {
     1124                baos.write(buf, 0, len);
     1125            }
     1126            return baos.toByteArray();
     1127        } finally {
     1128            try {
     1129                if(fis != null) {
     1130                    fis.close();
     1131                }
     1132            } catch(IOException foo) {
     1133            }
     1134        }
     1135    // we won't ever get here
    10921136    }
    10931137
     
    11041148
    11051149    private static class OnTimeout implements Runnable {
     1150
    11061151        private Socket _socket;
    11071152        private OutputStream _out;
     
    11101155        private String _wwwProxy;
    11111156        private long _requestId;
     1157
    11121158        public OnTimeout(Socket s, OutputStream out, String target, boolean usingProxy, String wwwProxy, long id) {
    11131159            _socket = s;
     
    11181164            _requestId = id;
    11191165        }
     1166
    11201167        public void run() {
    11211168            //if (_log.shouldLog(Log.DEBUG))
    11221169            //    _log.debug("Timeout occured requesting " + _target);
    11231170            handleHTTPClientException(new RuntimeException("Timeout"), _out,
    1124                                       _target, _usingProxy, _wwwProxy, _requestId);
     1171                    _target, _usingProxy, _wwwProxy, _requestId);
    11251172            closeSocket(_socket);
    11261173        }
    11271174    }
    1128 
    11291175    public static final String DEFAULT_JUMP_SERVERS =
    1130                                            "http://i2host.i2p/cgi-bin/i2hostjump?," +
    1131                                            "http://stats.i2p/cgi-bin/jump.cgi?a=," +
    1132                                            "http://i2jump.i2p/";
     1176                               "http://i2host.i2p/cgi-bin/i2hostjump?," +
     1177            "http://stats.i2p/cgi-bin/jump.cgi?a=," +
     1178            "http://i2jump.i2p/";
    11331179
    11341180    /**
     
    11371183    private static void writeErrorMessage(byte[] errMessage, OutputStream out, String targetRequest,
    11381184                                          boolean usingWWWProxy, String wwwProxy, String jumpServers) throws IOException {
    1139         if (out != null) {
     1185        if(out != null) {
    11401186            out.write(errMessage);
    1141             if (targetRequest != null) {
     1187            if(targetRequest != null) {
    11421188                String uri = targetRequest.replace("&", "&amp;");
    11431189                out.write("<a href=\"".getBytes());
     
    11461192                out.write(uri.getBytes());
    11471193                out.write("</a>".getBytes());
    1148                 if (usingWWWProxy) {
     1194                if(usingWWWProxy) {
    11491195                    out.write(("<br><br><b>").getBytes());
    11501196                    out.write(_("HTTP Outproxy").getBytes("UTF-8"));
    11511197                    out.write((":</b> " + wwwProxy).getBytes());
    11521198                }
    1153                 if (jumpServers != null && jumpServers.length() > 0) {
     1199                if(jumpServers != null && jumpServers.length() > 0) {
    11541200                    out.write("<br><br>".getBytes());
    11551201                    out.write(_("Click a link below to look for an address helper by using a \"jump\" service:").getBytes("UTF-8"));
    11561202                    out.write("<br>\n".getBytes());
    11571203
    1158                     if (uri.startsWith("http://"))
     1204                    if(uri.startsWith("http://")) {
    11591205                        uri = uri.substring(7);
     1206                    }
    11601207                    StringTokenizer tok = new StringTokenizer(jumpServers, ", ");
    1161                     while (tok.hasMoreTokens()) {
     1208                    while(tok.hasMoreTokens()) {
    11621209                        String jurl = tok.nextToken();
    1163                         if (!jurl.startsWith("http://"))
     1210                        if(!jurl.startsWith("http://")) {
    11641211                            continue;
     1212                        }
    11651213                        // Skip jump servers we don't know
    11661214                        String jumphost = jurl.substring(7);  // "http://"
    11671215                        jumphost = jumphost.substring(0, jumphost.indexOf('/'));
    1168                         if (!jumphost.endsWith(".i2p"))
     1216                        if(!jumphost.endsWith(".i2p")) {
    11691217                            continue;
    1170                         if (!jumphost.endsWith(".b32.i2p")) {
     1218                        }
     1219                        if(!jumphost.endsWith(".b32.i2p")) {
    11711220                            Destination dest = I2PAppContext.getGlobalContext().namingService().lookup(jumphost);
    1172                             if (dest == null) continue;
     1221                            if(dest == null) {
     1222                                continue;
     1223                            }
    11731224                        }
    11741225
     
    11941245        //if (_log.shouldLog(Log.WARN))
    11951246        //    _log.warn(getPrefix(requestId) + "Error sending to " + wwwProxy + " (proxy? " + usingWWWProxy + ", request: " + targetRequest, ex);
    1196         if (out != null) {
     1247        if(out != null) {
    11971248            try {
    11981249                byte[] header;
    1199                 if (usingWWWProxy)
     1250                if(usingWWWProxy) {
    12001251                    header = getErrorPage(I2PAppContext.getGlobalContext(), "dnfp", ERR_DESTINATION_UNKNOWN);
    1201                 else
     1252                } else {
    12021253                    header = getErrorPage(I2PAppContext.getGlobalContext(), "dnf", ERR_DESTINATION_UNKNOWN);
     1254                }
    12031255                writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, null);
    1204             } catch (IOException ioe) {
     1256            } catch(IOException ioe) {
    12051257                // static
    12061258                //_log.warn(getPrefix(requestId) + "Error writing out the 'destination was unknown' " + "message", ioe);
     
    12141266    /** @param host ignored */
    12151267    private static boolean isSupportedAddress(String host, String protocol) {
    1216         if ((host == null) || (protocol == null)) return false;
    1217 
    1218      /****
    1219        *  Let's not look up the name _again_
    1220        *  and now that host is a b32, this was failing
    1221        *
     1268        if((host == null) || (protocol == null)) {
     1269            return false;
     1270        }
     1271
     1272        /****
     1273         *  Let's not look up the name _again_
     1274         *  and now that host is a b32, this was failing
     1275         *
    12221276        boolean found = false;
    12231277        String lcHost = host.toLowerCase();
    12241278        for (int i = 0; i < SUPPORTED_HOSTS.length; i++) {
    1225             if (SUPPORTED_HOSTS[i].equals(lcHost)) {
    1226                 found = true;
    1227                 break;
    1228             }
     1279        if (SUPPORTED_HOSTS[i].equals(lcHost)) {
     1280        found = true;
     1281        break;
     1282        }
    12291283        }
    12301284
    12311285        if (!found) {
    1232             try {
    1233                 Destination d = _context.namingService().lookup(host);
    1234                 if (d == null) return false;
    1235             } catch (DataFormatException dfe) {
    1236             }
    1237         }
    1238       ****/
     1286        try {
     1287        Destination d = _context.namingService().lookup(host);
     1288        if (d == null) return false;
     1289        } catch (DataFormatException dfe) {
     1290        }
     1291        }
     1292         ****/
    12391293        return protocol.toLowerCase(Locale.US).equals("http");
    12401294    }
    1241 
    12421295    private final static byte[] ERR_HELPER_DISABLED =
    1243         ("HTTP/1.1 403 Disabled\r\n"+
    1244          "Content-Type: text/plain\r\n"+
    1245          "\r\n"+
    1246          "Address helpers disabled")
    1247         .getBytes();
     1296                                ("HTTP/1.1 403 Disabled\r\n" +
     1297            "Content-Type: text/plain\r\n" +
     1298            "\r\n" +
     1299            "Address helpers disabled").getBytes();
    12481300
    12491301    /**
     
    12631315    private static URI changeURI(URI uri, String host, int port, String path) throws URISyntaxException {
    12641316        return new URI(uri.getScheme(),
    1265                        null,
    1266                        host != null ? host : uri.getHost(),
    1267                        port != 0 ? port : uri.getPort(),
    1268                        path != null ? path : uri.getPath(),
    1269                        // FIXME this breaks encoded =, &
    1270                        uri.getQuery(),
    1271                        null);
     1317                null,
     1318                host != null ? host : uri.getHost(),
     1319                port != 0 ? port : uri.getPort(),
     1320                path != null ? path : uri.getPath(),
     1321                // FIXME this breaks encoded =, &
     1322                uri.getQuery(),
     1323                null);
    12721324    }
    12731325
     
    12821334    private static URI replaceQuery(URI uri, String query) throws URISyntaxException {
    12831335        URI rv = uri;
    1284         if (rv.getRawQuery() != null) {
     1336        if(rv.getRawQuery() != null) {
    12851337            rv = new URI(rv.getScheme(),
    1286                        null,
    1287                        uri.getHost(),
    1288                        uri.getPort(),
    1289                        uri.getPath(),
    1290                        null,
    1291                        null);
    1292         }
    1293         if (query != null) {
     1338                    null,
     1339                    uri.getHost(),
     1340                    uri.getPort(),
     1341                    uri.getPath(),
     1342                    null,
     1343                    null);
     1344        }
     1345        if(query != null) {
    12941346            String newURI = rv.toASCIIString() + '?' + query;
    12951347            rv = new URI(newURI);
     
    13111363        int valstart = -1;
    13121364        String key = null;
    1313         for (int i = 0; i <= query.length(); i++) {
     1365        for(int i = 0; i <= query.length(); i++) {
    13141366            char c = i < query.length() ? query.charAt(i) : '&';
    1315             if (c == ';' || c == '&') {
     1367            if(c == ';' || c == '&') {
    13161368                // end of key or value
    1317                 if (valstart < 0)
     1369                if(valstart < 0) {
    13181370                    key = query.substring(keystart, i);
     1371                }
    13191372                String decodedKey = LocalHTTPServer.decode(key);
    1320                 if (decodedKey.equals(HELPER_PARAM)) {
     1373                if(decodedKey.equals(HELPER_PARAM)) {
    13211374                    String newQuery = keystart > 0 ? query.substring(0, keystart - 1) : "";
    1322                     if (i < query.length() - 1) {
    1323                         if (keystart > 0)
     1375                    if(i < query.length() - 1) {
     1376                        if(keystart > 0) {
    13241377                            newQuery += query.substring(i);
    1325                         else
     1378                        } else {
    13261379                            newQuery += query.substring(i + 1);
     1380                        }
    13271381                    }
    13281382                    String value = valstart >= 0 ? query.substring(valstart, i) : "";
    13291383                    String helperValue = LocalHTTPServer.decode(value);
    1330                     return new String[] { newQuery, helperValue };
     1384                    return new String[] {newQuery, helperValue};
    13311385                }
    13321386                keystart = i + 1;
    13331387                valstart = -1;
    1334             } else if (c == '=') {
     1388            } else if(c == '=') {
    13351389                // end of key
    13361390                key = query.substring(keystart, i);
     
    13401394        return null;
    13411395    }
    1342 
    1343 /****
     1396    /****
    13441397    private static String[] tests = {
    1345         "", "foo", "foo=bar", "&", "&=&", "===", "&&",
    1346         "i2paddresshelper=foo",
    1347         "i2paddresshelpe=foo",
    1348         "2paddresshelper=foo",
    1349         "i2paddresshelper=%66oo",
    1350         "%692paddresshelper=foo",
    1351         "i2paddresshelper=foo&a=b",
    1352         "a=b&i2paddresshelper=foo",
    1353         "a=b&i2paddresshelper&c=d",
    1354         "a=b&i2paddresshelper=foo&c=d",
    1355         "a=b;i2paddresshelper=foo;c=d",
    1356         "a=b&i2paddresshelper=foo&c"
     1398    "", "foo", "foo=bar", "&", "&=&", "===", "&&",
     1399    "i2paddresshelper=foo",
     1400    "i2paddresshelpe=foo",
     1401    "2paddresshelper=foo",
     1402    "i2paddresshelper=%66oo",
     1403    "%692paddresshelper=foo",
     1404    "i2paddresshelper=foo&a=b",
     1405    "a=b&i2paddresshelper=foo",
     1406    "a=b&i2paddresshelper&c=d",
     1407    "a=b&i2paddresshelper=foo&c=d",
     1408    "a=b;i2paddresshelper=foo;c=d",
     1409    "a=b&i2paddresshelper=foo&c"
    13571410    };
    13581411
    13591412    public static void main(String[] args) {
    1360         for (int i = 0; i < tests.length; i++) {
    1361             String[] s = removeHelper(tests[i]);
    1362             if (s != null)
    1363                 System.out.println("Test \"" + tests[i] + "\" q=\"" + s[0] + "\" h=\"" + s[1] + "\"");
    1364             else
    1365                 System.out.println("Test \"" + tests[i] + "\" no match");
    1366         }
    1367     }
    1368 ****/
    1369 
     1413    for (int i = 0; i < tests.length; i++) {
     1414    String[] s = removeHelper(tests[i]);
     1415    if (s != null)
     1416    System.out.println("Test \"" + tests[i] + "\" q=\"" + s[0] + "\" h=\"" + s[1] + "\"");
     1417    else
     1418    System.out.println("Test \"" + tests[i] + "\" no match");
     1419    }
     1420    }
     1421     ****/
    13701422    /** */
    13711423    private static final String BUNDLE_NAME = "net.i2p.i2ptunnel.web.messages";
     
    13851437        return Translate.getString(key, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
    13861438    }
    1387 
    13881439}
  • history.txt

    r11ff89f r97f2328  
     12012-03-27 sponge
     2  * A hopeful fix to allow SHOUTcast/icecast to work over the http proxy.
     3  * A little more code clean up
     4
    152012-03-26 zzz
    26  * Code cleanups:
     
    104108
    1051092012-03-13 sponge
    106   * Plugins: 
     110  * Plugins:
    107111     - Handle 'file://' URLs for installation and updates (ticket #429).
    108112       You must specify the entire path, e.g.
     
    13541358  * Jbigi / NBI / wrapper / installer:
    13551359    jbigi and wrapper files for arm.
    1356     Compiled on trimslice with gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) 
     1360    Compiled on trimslice with gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
    13571361    Log postinstall errors to postinstall.log.
    13581362  * NetDB: Increase floodfills and better adjustment based on available memory
     
    13721376   * Add jcpuid files (32 & 64bit) for Intel Macs
    13731377   * Compile jbigi-osx-none for Intel Macs. libjbigi-osx-none.jnilib
    1374      is now a fat binary combining the already existing PPC 
     1378     is now a fat binary combining the already existing PPC
    13751379     compile and my new x86 build.
    1376        
     1380
    137713812011-06-11 zzz
    13781382    * i2psnark Polish translation, thanks polacco
     
    14191423
    142014242011-06-08 kytv
    1421     * Update jbigi/jcpuid Windows dlls. As was done for FreeBSD and Linux, the 
    1422       libraries for 32bit CPUs were linked against gmp-4.3.2 and those for the 
     1425    * Update jbigi/jcpuid Windows dlls. As was done for FreeBSD and Linux, the
     1426      libraries for 32bit CPUs were linked against gmp-4.3.2 and those for the
    14231427      64bit CPUs were linked against gmp-5.0.2.
    14241428
     
    14301434      - OSX: Both Intel and PPC Macs are supported. 32-bit support. If you'd like 64-bit
    14311435        support, please file a bug in trac with the output of "uname -m".
    1432     * Upgrade jbigi/jcpuid for FreeBSD i386 and add support for amd64. As was done with 
     1436    * Upgrade jbigi/jcpuid for FreeBSD i386 and add support for amd64. As was done with
    14331437      the Linux compiles, 32bit compiles were linked with gmp 4.3.2 and 64 bit builds
    14341438      (as well as 32bit builds for 64bit cpus) were linked against gmp 5.0.2.
     
    15141518    * Remove the one little html file that ends up in BOB.jar.
    15151519        The file is NOT a javadoc file, it is a package file.
    1516         Still, it is zapped. 
     1520        Still, it is zapped.
    15171521
    151815222011-05-31 zzz
     
    16831687      - routerconsole, i2ptunnel, i2psnark, SusiDNS, Susimail fully translated into Spanish
    16841688        (thx to PunkiBastardo and user)
    1685     * routerconsole, i2psnark, ... 
     1689    * routerconsole, i2psnark, ...
    16861690      - French translations completed by magma
    1687      
     1691
    168816922011-03-22 zzz
    16891693    * Handle GNU JRE returning Long.MAX_VALUE for max memory
     
    21212125
    212221262010-12-06 dr|z3d
    2123     * I2PSnark: 
     2127    * I2PSnark:
    21242128      - Resolve table header wrapping issue.
    21252129      - Vanilla/Ubergine theme enhancements.
    2126      
     2130
    212721312010-12-05 zzz
    21282132    * DataHelper: Have readLong() and readString() throw an
     
    21412145
    214221462010-12-01 dr|z3d
    2143     * Console: 
     2147    * Console:
    21442148      - Extensive reworking of ieshim.css for classic theme/Internet Explorer.
    21452149      - Additional console_big.css files for other themes to enhance doublebyte glyph support.
    2146     * I2PSnark: 
     2150    * I2PSnark:
    21472151      - Make show/hide peers and stop/start all torrent buttons more obvious.
    21482152      - Rework Vanilla icons to bring in line with color scheme.
     
    22042208
    220522092010-11-27 dr|z3d
    2206    * I2PSnark: New alternative theme: "Vanilla". 
    2207    * Big thanks to sponge for implementing the theme changer!   
     2210   * I2PSnark: New alternative theme: "Vanilla".
     2211   * Big thanks to sponge for implementing the theme changer!
    22082212
    220922132010-11-27 sponge
     
    37233727
    372437282009-10-09 dr|z3d
    3725     * Add paste.i2p2.i2p, and echelon's software links to readmes (thanks 
     3729    * Add paste.i2p2.i2p, and echelon's software links to readmes (thanks
    37263730      to GoHE for Swedish translations); cosmetic tweaks to same.
    37273731    * Various optimizations and tweaks to all 3 themes.
     
    374837522009-09-21 sponge
    37493753    * fixups to SlackBuilds. requiredbuilder does the wrong thing, and
    3750       thinks that java is perl! This isn't really a big deal, 
     3754      thinks that java is perl! This isn't really a big deal,
    37513755      the file format is simple enough and the requirements are known.
    37523756
     
    391139152009-08-15 sponge
    39123916    * Merge in dr|z3d and my own html fixes for router console java and jsp
    3913       files so that Opera (and now IE?) doesn't puke anymore on the missing 
     3917      files so that Opera (and now IE?) doesn't puke anymore on the missing
    39143918      and misplaced HTML tags.
    39153919    * Optimized all jsp files so that they are shorter to save space, which
     
    39723976      - Ensure functionality with new sidepanel layout
    39733977      - Custom hacks for IE/classic
    3974       - Enhanced form/button presentation   
     3978      - Enhanced form/button presentation
    39753979
    397639802009-08-07 zzz
     
    40184022    * Better support for Internet Explorer/classic theme.
    40194023    * Incremental improvements to classic theme.
    4020     * More UI tweaks and fiddles. 
     4024    * More UI tweaks and fiddles.
    40214025    * Fixes for I2PSnark UI; more to come.
    4022    
     4026
    402340272009-07-31 dr|z3d
    4024     * Resolve anomalous buttons and text fields in console ui. 
     4028    * Resolve anomalous buttons and text fields in console ui.
    40254029    * Enhance presentation of data in /peers.jsp.
    40264030    * Fix themes issue with horizontal width of radio/checkbox icons.
     
    40784082
    407940832009-07-21 dr|z3d
    4080     * First stage of overhaul of webapps ui. 
     4084    * First stage of overhaul of webapps ui.
    40814085      susidns, susimail & i2psnark now lightly themed.
    40824086    * Proxy error messages now themed as per chosen theme.
     
    417041742009-07-11 dr|z3d
    41714175    * More enhancements to the router console, consolidation of the
    4172       light and dark themes.     
     4176      light and dark themes.
    41734177      - Apply new themes with routerconsole.theme=light/dark/classic
    41744178        added to advanced config.
     
    419642002009-07-07 dr|z3d
    41974201    * Introducing 2 new console themes (light & dark), in addition
    4198       to changes to the console navigation; navbar now resides in 
     4202      to changes to the console navigation; navbar now resides in
    41994203      the sidepanel and other stuff besides. More to follow!
    42004204
     
    42834287      #  Log    i2p.dir.log     getLogDir()     logs/
    42844288      #  App    i2p.dir.app     getAppDir()     eepsite/, ...
    4285      
     4289
    42864290      *  Note that the router can't control where the wrapper actually puts its files.
    42874291
     
    44214425        Upgrade to izpack 4.3.0 and add a short script to fix Vista install problems.
    44224426        (previous izpack was 3.7.2 from 2005-04-22)
    4423        
     4427
    44244428        izpack 4.3.0 from :
    44254429        http://dist.codehaus.org/izpack/releases/4.3.0/IzPack-install-4.3.0.jar
     
    44274431        (no signatures or sha1sums found on website, and the jar is unsigned)
    44284432        License: Apache 2.0
    4429        
     4433
    44304434        upack izpack:
    44314435        java -jar IzPack-install-4.3.0.jar
    44324436        or
    44334437        java -jar IzPack-install-4.3.0.jar -console
    4434        
     4438
    44354439        get the standalone-compiler.jar from the installation lib/ directory:
    44364440        SHA1 6d2b4a5657bfb864a333b1c4b1c0f8223aa57d80
    44374441        (no signatures or sha1sums found on website, and the jar is unsigned)
    4438        
     4442
    44394443        This fixes the bug with the install windows centered in all the
    44404444        workspaces, not the current workspace. And who knows what other
    44414445        bugs in the last 4 years.
    4442        
     4446
    44434447        To fix Vista (and presumably Windows 7) permissiom problems,
    44444448        add a run-privileged flag for those, and run the new fixperms.bat
    44454449        which calls icacls to add the privileges to the install directory.
    4446        
     4450
    44474451        Add support for 6 more language packs found in the new release.
    44484452        Change from ISO3 codes to native language names.
    4449        
     4453
    44504454        Disable creation of the i2p.tar.bz2 file in build.xml
    44514455        (distributed as i2pheadless-0.7.x.tar.bz2), as izpack 4.3.0 now
     
    52095213
    521052142009-01-31 sponge
    5211     * One line BOB discarded interger fix 
     5215    * One line BOB discarded interger fix
    52125216      (not that it mattered at this point)
    52135217
     
    57865790      - Synchronize to prevent concurrent writes (thanks Galen!)
    57875791      - Backup keys every 7 days instead of every 5 minutes
    5788     * LoadTestManager: Don't instantiate, it's disabled 
     5792    * LoadTestManager: Don't instantiate, it's disabled
    57895793    * Router console: Flag placeholder pages as noncacheable
    57905794    * Streaming lib:
     
    59535957      - Add an updaterSmall target which includes only the essentials
    59545958      - Add an updaterRouter target which includes only i2p.jar and router.jar
    5955       - Clean up the build file some 
     5959      - Clean up the build file some
    59565960      - Remove empty eepsite/ and subdirs from i2pupdate.zip
    59575961    * configtunnels.jsp: Add warning
     
    71847188
    718571892006-04-19  jrandom
    7186     * Adjust how we pick high capacity peers to allow the inclusion of fast 
     7190    * Adjust how we pick high capacity peers to allow the inclusion of fast
    71877191      peers (the previous filter assumed an old usage pattern)
    71887192    * New set of stats to help track per-packet-type bandwidth usage better
     
    72707274    * Fixes to the message reply registry (thanks Complication!)
    72717275    * More comprehensive syndie banning (for repeated pushes)
    7272     * Publish the router's ballpark bandwidth limit (w/in a power of 2), for 
     7276    * Publish the router's ballpark bandwidth limit (w/in a power of 2), for
    72737277      testing purposes
    72747278    * Put a floor back on the capacity threshold, so too many failing peers
     
    75787582    * Fix console bandwidth limiter burst rate dropdowns, so the display
    75797583      relates to what is saved in the config.
    7580    
     7584
    758175852006-02-12  cervantes
    7582     * SML is now stricter in it's formatting (attributes should only use 
     7586    * SML is now stricter in it's formatting (attributes should only use
    75837587      double quotes instead of being allowed to mix with singles).
    75847588    * Using apostrophes in SML attributes will no longer invalidate the tag.
     
    77167720
    771777212006-01-17  jrandom
    7718     * First pass of the new tunnel creation crypto, specified in the new 
     7722    * First pass of the new tunnel creation crypto, specified in the new
    77197723      router/doc/tunnel-alt-creation.html (referenced in the current
    77207724      router/doc/tunnel-alt.html).  It isn't actually used anywhere yet, other
     
    772777312006-01-14  cervantes
    77287732    * Removed entirely misleading memory status from the console summary.
    7729        
     7733
    773077342006-01-13  cervantes
    77317735    * Further Syndie layout hardening and typeface balancing.
     
    78087812    * Disable multifile torrent creation in I2PSnark's web UI for the moment
    78097813      (though it can still seed and participate in multifile swarms)
    7810     * Enable a new speed calculation for profiling peers, using their peak 
     7814    * Enable a new speed calculation for profiling peers, using their peak
    78117815      1 minute average tunnel throughput as their speed.
    78127816
     
    785278562005-12-22  jrandom
    78537857    * Bundle the standalone I2PSnark launcher in the installer and update
    7854       process (launch as "java -jar launch-i2psnark.jar", viewing the 
     7858      process (launch as "java -jar launch-i2psnark.jar", viewing the
    78557859      interface on http://localhost:8002/)
    78567860    * Don't autostart swarming torrents by default so that you can run a
     
    79697973      replacement
    79707974    * Make tunnel creation times randomized - there is existing code to
    7971       randomize the tunnels but it isn't effective due to the tunnel creation 
     7975      randomize the tunnels but it isn't effective due to the tunnel creation
    79727976      strategy. Currently, most tunnels get built all at once, at about 2 1/2
    7973       to 3 minutes before expiration. The patch fixes this by fixing the 
     7977      to 3 minutes before expiration. The patch fixes this by fixing the
    79747978      randomization, and by changing the overlap time (with old tunnels) to a
    79757979      range of 2 to 4 minutes.
     
    79927996
    799379972005-12-05  jrandom
    7994     * Added an RDF and XML thread export to Syndie, reachable at 
     7998    * Added an RDF and XML thread export to Syndie, reachable at
    79957999      .../threadnav/rdf or .../threadnav/xml, accepting the parameters
    79968000      count=$numThreads and offset=$threadIndex.  If the $numThreads is -1, it
     
    80968100      better)
    80978101
    8098 2005-11-26  jrandom 
     81022005-11-26  jrandom
    80998103    * Be more explicit about what messages we will handle through a client
    81008104      tunnel, and how we will handle them.  This cuts off a set of attacks
     
    81908194      creating their own skins until the markup has solidified.
    81918195    * Added "routerconsole.javascript.disabled=true" to disable console
    8192       client-side scripting and "routerconsole.css.disabled=true" to remove 
     8196      client-side scripting and "routerconsole.css.disabled=true" to remove
    81938197      css styling (only rolled out in the i2ptunnel interface currently)
    81948198    * Fixed long standing bug with i2ptunnel client and server edit screens
    81958199      where tunnel count and depth properties would fail to save. Added
    81968200      backup quantity and variance configuration options.
    8197     * Added basic accessibility support (key shortcuts, linear markup, alt and 
     8201    * Added basic accessibility support (key shortcuts, linear markup, alt and
    81988202      title information and form labels).
    81998203    * So far only tested on IE6, Firefox 1.0.6, Opera 8 and lynx.
     
    83898393      CTCP messages except ACTION, as well as stripping the hostname from the
    83908394      USER message (while leaving the nick and 'full name').  The IRC proxy
    8391       doesn't use this by default, but you can enable it by creating a new 
     8395      doesn't use this by default, but you can enable it by creating a new
    83928396      "IRC proxy" tunnel on the web interface, or by changing the tunnel type
    83938397      to "ircclient" in i2ptunnel.config.
     
    84058409
    840684102005-10-09  jrandom
    8407     * Now that the streaming lib works reasonably, set the default inactivity 
     8411    * Now that the streaming lib works reasonably, set the default inactivity
    84088412      event to send a 0 byte keepalive payload, rather than disconnecting the
    84098413      stream.  This should cut the irc netsplits and help out with other long
     
    84208424
    842184252005-10-07  jrandom
    8422     * Include the 1 second bandwidth usage on the console rather than the 
     8426    * Include the 1 second bandwidth usage on the console rather than the
    84238427      1 minute rate, as the 1 second value doesn't have the 1m/5m quantization
    84248428      issues.
     
    842684302005-10-07  jrandom
    84278431    * Allow the I2PTunnelHTTPServer to send back the first few packets of an
    8428       HTTP response quicker, and initialize the streaming lib's cwin more 
     8432      HTTP response quicker, and initialize the streaming lib's cwin more
    84298433      carefully.
    84308434    * Added a small web UI to the new Syndie scheduled updater.  If you log in
     
    843584392005-10-05  jrandom
    84368440    * Allow the first few packets in the stream to fill in their IDs during
    8437       handshake (thanks cervantes, Complication, et al!)  This should fix at 
     8441      handshake (thanks cervantes, Complication, et al!)  This should fix at
    84388442      least some of the intermittent HTTP POST issues.
    84398443
     
    84498453
    845084542005-10-03  rangarok
    8451     * Changed default update delay to twelve hours, and enforced a minimum 
     8455    * Changed default update delay to twelve hours, and enforced a minimum
    84528456      delay of one hour.
    84538457
    845484582005-10-03  ragnarok
    84558459    * Implemented a Syndie auto-updater.  It will automatically pull new posts
    8456       from selected syndie archives.  To try it out, add 
    8457       syndie.updateArchives=<comma seperated list of syndie archives> to your 
     8460      from selected syndie archives.  To try it out, add
     8461      syndie.updateArchives=<comma seperated list of syndie archives> to your
    84588462      syndie.config.  Archives must be specified as the full url to archive.txt
    84598463      (e.g. http://syndiemedia.i2p/archive/archive.txt).  By default, it checks
    8460       for new posts every hour.  This can be modified by setting 
    8461       syndie.updateDelay=<delay in hours> also in syndie.config. 
     8464      for new posts every hour.  This can be modified by setting
     8465      syndie.updateDelay=<delay in hours> also in syndie.config.
    84628466
    84638467* 2005-10-01  0.6.1.1 released
    84648468
    846584692005-09-30  ragnarok
    8466     * Implemented conditional get for syndie remote archive imports. 
     8470    * Implemented conditional get for syndie remote archive imports.
    84678471
    846884722005-09-30  jrandom
     
    84798483
    848084842005-09-29  ragnarok
    8481     * Export petnames from syndie to the router's petname db instead of 
     8485    * Export petnames from syndie to the router's petname db instead of
    84828486      userhosts.txt.
    84838487
    848484882005-09-29  jrandom
    84858489    * Support noreseed.i2p in addition to .i2pnoreseed for disabling automatic
    8486       reseeding - useful on OSes that make it hard to create dot files. 
     8490      reseeding - useful on OSes that make it hard to create dot files.
    84878491      Thanks Complication (and anon)!
    84888492    * Fixed the installer version string (thanks Frontier!)
     
    849685002005-09-29  jrandom
    84978501    * Let syndie users modify their metadata.
    8498     * Reseed the router on startup if there aren't enough peer references 
     8502    * Reseed the router on startup if there aren't enough peer references
    84998503      known locally.  This can be disabled by creating the file .i2pnoreseed
    85008504      in your home directory, and the existing detection and reseed handling
     
    851185152005-09-27  jrandom
    85128516    * I2PTunnel bugfix (thanks Complication!)
    8513     * Increase the SSU cwin slower during congestion avoidance (at k/cwin^2 
     8517    * Increase the SSU cwin slower during congestion avoidance (at k/cwin^2
    85148518      instead of k/cwin)
    85158519    * Limit the number of inbound SSU sessions being built at once (using
     
    852185252005-09-26  jrandom
    85228526    * Reworded the SSU introductions config section (thanks duck!)
    8523     * Force identity content encoding for I2PTunnel httpserver requests 
     8527    * Force identity content encoding for I2PTunnel httpserver requests
    85248528      (thanks redzara!)
    85258529    * Further x-i2p-gzip bugfixes for the end of streams
     
    853085342005-09-25  jrandom
    85318535    * Allow reseeding on the console if the netDb knows less than 30 peers,
    8532       rather than less than 10 (without internet connectivity, we keep the 
     8536      rather than less than 10 (without internet connectivity, we keep the
    85338537      last 15 router references)
    85348538    * Reenable the x-i2p-gzip HTTP processing by default, flushing the stream
     
    854585492005-09-25  jrandom
    85468550    * Fix a long standing streaming lib bug (in the inactivity detection code)
    8547     * Improved handling of initial streaming lib packet retransmissions to 
     8551    * Improved handling of initial streaming lib packet retransmissions to
    85488552      kill the "lost first packet" bug (where a page shows up with the first
    85498553      few KB missing)
    8550     * Add support for initial window sizes greater than 1 - useful for 
     8554    * Add support for initial window sizes greater than 1 - useful for
    85518555      eepsites to transmit e.g. 4 packets full of data along with the initial
    8552       ACK, thereby cutting down on the rtt latency.  The congestion window 
     8556      ACK, thereby cutting down on the rtt latency.  The congestion window
    85538557      size can and does still shrink down to 1 packet though.
    85548558    * Adjusted the streaming lib retransmission calculation algorithm to be
     
    856385672005-09-21  jrandom
    85648568    * Add support for HTTP POST to EepGet
    8565     * Use HTTP POST for syndie bulk fetches, since there's a lot of data to 
     8569    * Use HTTP POST for syndie bulk fetches, since there's a lot of data to
    85668570      put in that URL.
    85678571
    856885722005-09-18  jrandom
    8569     * Added support for pure 64bit linux with jbigi and the java service 
    8570       wrapper (no need for jcpuid if we're on os.arch=amd64).  Thanks mule 
     8573    * Added support for pure 64bit linux with jbigi and the java service
     8574      wrapper (no need for jcpuid if we're on os.arch=amd64).  Thanks mule
    85718575      et al for help testing!
    85728576    * UI cleanup in Syndie (thanks gloin and bar!)
     
    85788582    * Implemented a naming service using Syndie's petname db.  It's not enabled
    85798583      by default, but you can try it out by setting
    8580       i2p.naming.impl=net.i2p.client.naming.PetNameNamingService in 
     8584      i2p.naming.impl=net.i2p.client.naming.PetNameNamingService in
    85818585      router.config.
    8582     * Implemented a meta naming service that will first lookup names in the 
     8586    * Implemented a meta naming service that will first lookup names in the
    85838587      PetNameNamingService then fallback on the HostTxtNamingService.  Which
    8584       naming services are checked and in which order is specified by 
     8588      naming services are checked and in which order is specified by
    85858589      i2p.nameservicelist.  This will probably become the default naming service
    85868590      so please help test it out by setting
    85878591      i2p.naming.impl=net.i2p.client.naming.MetaNamingService in router.config.
    8588      
     8592
    85898593* 2005-09-17  0.6.0.6 released
    85908594
    859185952005-09-17  jrandom
    8592     * Clean up syndie a bit more and bundle a default introductory post with 
     8596    * Clean up syndie a bit more and bundle a default introductory post with
    85938597      both new installs and updates.
    85948598    * Typo fixes on the console (thanks bar!)
     
    859686002005-09-17  jrandom
    85978601    * Updated the bandwidth limiter to use two tiers of bandwidth - our normal
    8598       steady state rate, plus a new limit on how fast we transfer when 
    8599       bursting.  This is different from the old "burst as fast as possible 
     8602      steady state rate, plus a new limit on how fast we transfer when
     8603      bursting.  This is different from the old "burst as fast as possible
    86008604      until we're out of tokens" policy, and should help those with congested
    86018605      networks.  See /config.jsp to manage this rate.
     
    86108614      don't bundle the binutils necessary (and there'd be a naming conflict
    86118615      if we did).
    8612     * Added 'single user' functionality to syndie - if the single user 
     8616    * Added 'single user' functionality to syndie - if the single user
    86138617      checkbox on the admin page is checked, all users are allowed to control
    86148618      the instance and sync up with remote syndie nodes.
     
    86218625
    862286262005-09-16  jrandom
    8623     * Adjust I2PTunnelHTTPServer so it can be used for outproxy operators 
     8627    * Adjust I2PTunnelHTTPServer so it can be used for outproxy operators
    86248628      (just specify the spoofed host as an empty string), allowing them to
    86258629      honor x-i2p-gzip encoding.
    86268630    * Let windows users build the exes too (thanks bar and redzara!)
    8627     * Allow I2PTunnel httpserver operators to disable gzip compression on 
    8628       individual tunnels with the i2ptunnel.gzip=false client option 
     8631    * Allow I2PTunnel httpserver operators to disable gzip compression on
     8632      individual tunnels with the i2ptunnel.gzip=false client option
    86298633      (good idea susi!)
    86308634
     
    86348638      service wrapper (called from the install dir as: sh runplain.sh)
    86358639    * Bundle susidns and syndie, with links on the top nav
    8636     * Have I2PTunnelHTTPClient and I2PTunnelHTTPServer use the x-i2p-gzip 
     8640    * Have I2PTunnelHTTPClient and I2PTunnelHTTPServer use the x-i2p-gzip
    86378641      content-encoding (if offered), reducing the payload size before it
    86388642      reaches the streaming lib.  The existing compression is at the i2cp
     
    86618665      using it can get the benefits of mode=best_effort).  Guaranteed delivery
    86628666      is offered at the streaming lib level.
    8663     * Improve the peer selection code for peer testing, as everyone now 
     8667    * Improve the peer selection code for peer testing, as everyone now
    86648668      supports tests.
    8665     * Give the watchdog its fangs - if it detects obscene job lag or if 
     8669    * Give the watchdog its fangs - if it detects obscene job lag or if
    86668670      clients have been unable to get a leaseSet for more than 5 minutes,
    8667       restart the router.  This was disabled a year ago due to spurious 
     8671      restart the router.  This was disabled a year ago due to spurious
    86688672      restarts, and can be disabled by "watchdog.haltOnHang=false", but the
    86698673      cause of the spurious restarts should be gone.
     
    86858689      if the router has net.i2p.router.transport.FIFOBandwidthLimiter=INFO in
    86868690      the logger config, keep track of the 1 second transfer rates as the stat
    8687       'bw.sendBps1s' and 'bw.recvBps1s', allowing closer monitoring of burst 
     8691      'bw.sendBps1s' and 'bw.recvBps1s', allowing closer monitoring of burst
    86888692      behavior.
    86898693
     
    87008704
    870187052005-09-07  jrandom
    8702     * Lay the foundation for 'client routers' - the ability for peers to opt 
    8703       out of participating in tunnels entirely due to firewall/NAT issues. 
    8704       Individual routers have control over where those peers are used in 
    8705       tunnels - in outbound or inbound, exploratory or client tunnels, or 
     8706    * Lay the foundation for 'client routers' - the ability for peers to opt
     8707      out of participating in tunnels entirely due to firewall/NAT issues.
     8708      Individual routers have control over where those peers are used in
     8709      tunnels - in outbound or inbound, exploratory or client tunnels, or
    87068710      none at all.  The defaults with this build are to simply act as before -
    87078711      placing everyone as potential participants in any tunnel.
    8708     * Another part of the foundation includes the option for netDb 
     8712    * Another part of the foundation includes the option for netDb
    87098713      participants to refuse to answer queries regarding peers who are marked
    8710       as unreachable, though this too is disabled by default (meaning the 
     8714      as unreachable, though this too is disabled by default (meaning the
    87118715      routerInfo is retrievable from the netDb).
    87128716
     
    87178721
    871887222005-09-04  jrandom
    8719     * Don't persist peer profiles until we are shutting down, as the 
     8723    * Don't persist peer profiles until we are shutting down, as the
    87208724      persistence process gobbles RAM and wall time.
    87218725    * Bugfix to allow you to check/uncheck the sharedClient setting on the
    87228726      I2PTunnel web interface (thanks BarkerJr!)
    8723     * Be more careful when expiring a failed tunnel message fragment so we 
     8727    * Be more careful when expiring a failed tunnel message fragment so we
    87248728      don't drop the data while attempting to read it.
    87258729
     
    87278731
    872887322005-09-02  jrandom
    8729     * Don't refuse to send a netDb store if the targetted peer has failed a 
     8733    * Don't refuse to send a netDb store if the targetted peer has failed a
    87308734      bit (the value was an arbitrary amount).
    87318735    * Logging changes
     
    87408744    * Don't publish leaseSets to the netDb if they will never be looked for -
    87418745      namely, if they are for destinations that only establish outbound
    8742       streams.  I2PTunnel's 'client' and 'httpclient' proxies have been 
    8743       modified to tell the router that it doesn't need to publish their 
     8746      streams.  I2PTunnel's 'client' and 'httpclient' proxies have been
     8747      modified to tell the router that it doesn't need to publish their
    87448748      leaseSet (by setting the I2CP config option 'i2cp.dontPublishLeaseSet'
    87458749      to 'true').
     
    87578761
    875887622005-08-24  jrandom
    8759     * Catch errors with corrupt tunnel messages more gracefully (no need to 
     8763    * Catch errors with corrupt tunnel messages more gracefully (no need to
    87608764      kill the thread and cause an OOM...)
    8761     * Don't skip shitlisted peers for netDb store messages, as they aren't 
    8762       necessarily shitlisted by other people (though they probably are). 
     8765    * Don't skip shitlisted peers for netDb store messages, as they aren't
     8766      necessarily shitlisted by other people (though they probably are).
    87638767    * Adjust the netDb store per-peer timeout based on each particular peer's
    8764       profile (timeout = 4x their average netDb store response time)   
     8768      profile (timeout = 4x their average netDb store response time)
    87658769    * Don't republish leaseSets to *failed* peers - send them to peers who
    87668770      replied but just didn't know the value.
     
    87808784    * Include ack packets in the per-peer cwin throttle (they were part of the
    87818785      bandwidth limit though).
    8782     * Tweak the SSU cwin operation to get more accurrate estimates under 
     8786    * Tweak the SSU cwin operation to get more accurrate estimates under
    87838787      congestions.
    87848788    * SSU improvements to resend more efficiently.
     
    87888792
    878987932005-08-21  jrandom
    8790     * If we already have an established SSU session with the Charlie helping 
     8794    * If we already have an established SSU session with the Charlie helping
    87918795      test us, cancel the test with the status of "unknown".
    87928796
    879387972005-08-17  jrandom
    8794     * Revise the SSU peer testing protocol so that Bob verifies Charlie's 
     8798    * Revise the SSU peer testing protocol so that Bob verifies Charlie's
    87958799      viability before agreeing to Alice's request.  This doesn't work with
    87968800      older SSU peer test builds, but is backwards compatible (older nodes
    8797       won't ask newer nodes to participate in tests, and newer nodes won't 
     8801      won't ask newer nodes to participate in tests, and newer nodes won't
    87988802      ask older nodes to either).
    87998803
    880088042005-08-12  jrandom
    8801     * Keep detailed stats on the peer testing, publishing the results in the 
     8805    * Keep detailed stats on the peer testing, publishing the results in the
    88028806      netDb.
    88038807    * Don't overwrite the status with 'unknown' unless we haven't had a valid
     
    88108814      result was not OK, accept their suggestion, but queue up a peer test for
    88118815      later.
    8812     * Don't try to do a netDb store to a shitlisted peer, and adjust the way 
     8816    * Don't try to do a netDb store to a shitlisted peer, and adjust the way
    88138817      we monitor netDb store progress (to clear up the high netDb.storePeers
    88148818      stat)
     
    88188822      each router, as well as any time the user requests a test manually.  The
    88198823      tests do not reconfigure the ports at the moment, merely determine under
    8820       what conditions the local router is reachable.  The status shown in the 
    8821       top left will be "ERR-SymmetricNAT" if the user's IP and port show up 
    8822       differently for different peers, "ERR-Reject" if the router cannot 
    8823       receive unsolicited packets or the peer helping test could not find a 
    8824       collaborator, "Unknown" if the test has not been run or the test 
    8825       participants were unreachable, or "OK" if the router can receive 
     8824      what conditions the local router is reachable.  The status shown in the
     8825      top left will be "ERR-SymmetricNAT" if the user's IP and port show up
     8826      differently for different peers, "ERR-Reject" if the router cannot
     8827      receive unsolicited packets or the peer helping test could not find a
     8828      collaborator, "Unknown" if the test has not been run or the test
     8829      participants were unreachable, or "OK" if the router can receive
    88268830      unsolicited connections and those connections use the same IP and port.
    88278831
     
    88458849    * Removed an unnecessary SSU session drop
    88468850    * Reduced the MTU (until we get a working PMTU lib)
    8847     * Deferr tunnel acceptance until we know how to reach the next hop, 
     8851    * Deferr tunnel acceptance until we know how to reach the next hop,
    88488852      rejecting it if we can't find them in time.
    88498853    * If our netDb store of our leaseSet fails, give it a few seconds before
     
    88698873    * Adjust the netDb search and store per peer timeouts to match the average
    88708874      measured per peer success times, rather than huge fixed values.
    8871     * Optimized and reverified the netDb peer selection / retrieval process 
     8875    * Optimized and reverified the netDb peer selection / retrieval process
    88728876      within the kbuckets.
    88738877    * Drop TCP connections that don't have any useful activity in 10 minutes.
     
    88788882
    887988832005-07-27  jrandom
    8880     * Enabled SSU as the default top priority transport, adjusting the 
     8884    * Enabled SSU as the default top priority transport, adjusting the
    88818885      config.jsp page accordingly.
    88828886    * Add verification fields to the SSU and TCP connection negotiation (not
     
    88858889      tunnel-alt.html (have each hop encrypt the received IV before using it,
    88868890      then encrypt it again before sending it on)
    8887     * Disable the I2CP encryption, leaving in place the end to end garlic 
     8891    * Disable the I2CP encryption, leaving in place the end to end garlic
    88888892      encryption (another backwards incompatible change)
    88898893    * Adjust the protocol versions on the TCP and SSU transports so that they
     
    88958899
    889689002005-07-22  jrandom
    8897     * Use the small thread pool for I2PTunnelHTTPServer (already used for 
     8901    * Use the small thread pool for I2PTunnelHTTPServer (already used for
    88988902      I2PTunnelServer)
    88998903    * Minor memory churn reduction in I2CP
     
    89138917    * Further preparation for removing I2CP crypto
    89148918    * Added some validation to the DH key agreement (thanks $anon)
    8915     * Validate tunnel data message expirations (though not really a problem, 
     8919    * Validate tunnel data message expirations (though not really a problem,
    89168920      since tunnels expire)
    89178921    * Minor PRNG threading cleanup
     
    89228926
    892389272005-07-15  Romster
    8924     * Added per group selection toggles in the stats configuration console 
     8928    * Added per group selection toggles in the stats configuration console
    89258929      page.
    89268930
    892789312005-07-13  jrandom
    8928     * Fixed a recently injected bug in the multitransport bidding which had 
     8932    * Fixed a recently injected bug in the multitransport bidding which had
    89298933      allowed an essentially arbitrary choice of transports, rather than the
    89308934      properly ordered choice.
    89318935
    893289362005-07-13  jrandom
    8933     * Fixed a long standing bug where we weren't properly comparing session 
    8934       tags but instead largely depending upon comparing their hashCode, 
     8937    * Fixed a long standing bug where we weren't properly comparing session
     8938      tags but instead largely depending upon comparing their hashCode,
    89358939      causing intermittent decryption errors.
    89368940
    893789412005-07-12  jrandom
    8938     * Add some data duplication to avoid a recently injected concurrency 
     8942    * Add some data duplication to avoid a recently injected concurrency
    89398943      problem in the session tag manager (thanks redzara and romster).
    89408944
     
    89548958
    895589592005-07-05  jrandom
    8956     * Use a buffered PRNG, pulling the PRNG data off a larger precalculated 
     8960    * Use a buffered PRNG, pulling the PRNG data off a larger precalculated
    89578961      buffer, rather than the underlying PRNG's (likely small) one, which in
    89588962      turn reduces the frequency of recalcing.
     
    89608964
    896189652005-07-04  jrandom
    8962     * Within the tunnel, use xor(IV, msg[0:16]) as the flag to detect dups, 
    8963       rather than the IV by itself, preventing an attack that would let 
     8966    * Within the tunnel, use xor(IV, msg[0:16]) as the flag to detect dups,
     8967      rather than the IV by itself, preventing an attack that would let
    89648968      colluding internal adversaries tag a message to determine that they are
    89658969      in the same tunnel.  Thanks dvorak for the catch!
     
    89888992
    898989932005-04-30  jrandom
    8990     * Added a small new page to the web console (/peers.jsp) which contains 
    8991       the peer connection information.  This will be cleaned up a lot more 
     8994    * Added a small new page to the web console (/peers.jsp) which contains
     8995      the peer connection information.  This will be cleaned up a lot more
    89928996      before 0.6 is out, but its a start.
    89938997
     
    89969000
    899790012005-04-29  jrandom
    8998     * Reduce the peer profile stat coallesce overhead by inlining it with the 
     9002    * Reduce the peer profile stat coallesce overhead by inlining it with the
    89999003      reorganize.
    90009004    * Limit each transport to at most one address (any transport that requires
     
    90059009    * Add back the code to handle bids from multiple transports (though there
    90069010      is still only one transport enabled by default)
    9007     * Adjust the router's queueing of outbound client messages when under 
     9011    * Adjust the router's queueing of outbound client messages when under
    90089012      heavy load by running the preparatory job in the client's I2CP handler
    90099013      thread, thereby blocking additional outbound messages when the router is
     
    90179021
    901890222005-04-24  jrandom
    9019     * Added a pool of PRNGs using a different synchronization technique, 
     9023    * Added a pool of PRNGs using a different synchronization technique,
    90209024      hopefully sufficient to work around IBM's PRNG bugs until we get our
    90219025      own Fortuna.
    90229026    * In the streaming lib, don't jack up the RTT on NACK, and have the window
    9023       size bound the not-yet-ready messages to the peer, not the unacked 
     9027      size bound the not-yet-ready messages to the peer, not the unacked
    90249028      message count (not sure yet whether this is worthwile).
    90259029    * Many additions to the messageHistory log.
    9026     * Handle out of order tunnel fragment delivery (not an issue on the live 
     9030    * Handle out of order tunnel fragment delivery (not an issue on the live
    90279031      net with TCP, but critical with UDP).
    90289032
     
    90369040    * Have the message validator take into account expiration to cut down on
    90379041      false positives at high transfer rates.
    9038     * Allow configuration of the probabalistic window size growth rate in the 
    9039       streaming lib's slow start and congestion avoidance phases, and default 
    9040       them to a more conservative value (2), rather than the previous value 
     9042    * Allow configuration of the probabalistic window size growth rate in the
     9043      streaming lib's slow start and congestion avoidance phases, and default
     9044      them to a more conservative value (2), rather than the previous value
    90419045      (1).
    90429046    * Reduce the ack delay in the streaming lib to 500ms
     
    90479051
    904890522005-04-17  sirup
    9049     * Added the possibility for i2ptunnel client and httpclient instances to 
    9050       have their own i2p session (and hence, destination and tunnels).  By 
    9051       default, tunnels are shared, but that can be changed on the web 
     9053    * Added the possibility for i2ptunnel client and httpclient instances to
     9054      have their own i2p session (and hence, destination and tunnels).  By
     9055      default, tunnels are shared, but that can be changed on the web
    90529056      interface or with the sharedClient config option in i2ptunnel.config.
    90539057
    905490582005-04-17  jrandom
    90559059    * Marked the net.i2p.i2ptunnel.TunnelManager as deprecated.  Anyone use
    9056       this?  If not, I want to drop it (lots of tiny details with lots of 
     9060      this?  If not, I want to drop it (lots of tiny details with lots of
    90579061      duplicated semantics).
    90589062
     
    90619065
    906290662005-04-17  jrandom
    9063     * Revamp the tunnel building throttles, fixing a situation where the 
     9067    * Revamp the tunnel building throttles, fixing a situation where the
    90649068      rebuild may not recover, and defaulting it to unthrottled (users with
    90659069      slow CPUs may want to set "router.tunnel.shouldThrottle=true" in their
     
    90959099
    909691002005-04-05  jrandom
    9097     * After a successfull netDb search for a leaseSet, republish it to all of 
     9101    * After a successfull netDb search for a leaseSet, republish it to all of
    90989102      the peers we have tried so far who did not give us the key (up to 10),
    90999103      rather than the old K closest (which may include peers who had given us
    91009104      the key)
    9101     * Don't wait 5 minutes to publish a leaseSet (duh!), and rather than 
     9105    * Don't wait 5 minutes to publish a leaseSet (duh!), and rather than
    91029106      republish it every 5 minutes, republish it every 3.  In addition, always
    91039107      republish as soon as the leaseSet changes (duh^2).
     
    91069110
    910791112005-04-03  jrandom
    9108     * EepGet fix for open-ended HTTP fetches (such as the news.xml 
     9112    * EepGet fix for open-ended HTTP fetches (such as the news.xml
    91099113      feeding the NewsFetcher)
    91109114
    911191152005-04-01  jrandom
    9112     * Allow editing I2PTunnel server instances with five digit ports 
     9116    * Allow editing I2PTunnel server instances with five digit ports
    91139117      (thanks nickless_head!)
    91149118    * More NewsFetcher debugging for reported weirdness
     
    91279131    * Increased the default netDb store replication factor from 2 to 6 to take
    91289132      into consideration tunnel failures.
    9129     * Address some statistical anonymity attacks against the netDb that could 
    9130       be mounted by an active internal adversary by only answering lookups for 
     9133    * Address some statistical anonymity attacks against the netDb that could
     9134      be mounted by an active internal adversary by only answering lookups for
    91319135      leaseSets we received through an unsolicited store.
    91329136    * Don't throttle lookup responses (we throttle enough elsewhere)
     
    91479151
    914891522005-03-25  jrandom
    9149     * Fixed up building dependencies for the routerconsole on some more 
     9153    * Fixed up building dependencies for the routerconsole on some more
    91509154      aggressive compilers (thanks polecat!)
    91519155
     
    91539157
    915491582005-03-23  jrandom
    9155     * Added more intelligent version checking in news.xml, in case we have a 
     9159    * Added more intelligent version checking in news.xml, in case we have a
    91569160      version newer than the one specified.
    91579161
     
    91719175      update will be shown on the router console.
    91729176    * New initialNews.xml delivered with new installs, and moved news.xml out
    9173       of the i2pwww module and into the i2p module so that we can bundle it 
     9177      of the i2pwww module and into the i2p module so that we can bundle it
    91749178      within each update.
    91759179
    917691802005-03-23  jrandom
    9177     * New /configupdate.jsp page for controlling the update / notification 
     9181    * New /configupdate.jsp page for controlling the update / notification
    91789182      process, as well as various minor related updates.  Note that not all
    91799183      options are exposed yet, and the update detection code isn't in place
     
    91889192      (thanks P.Verdy!)
    91899193    * Added some helpers to the TrustedUpdate to work off streams and to offer
    9190       a minimal CLI: 
     9194      a minimal CLI:
    91919195          TrustedUpdate keygen pubKeyFile privKeyFile
    91929196          TrustedUpdate sign origFile signedFile privKeyFile
     
    91949198
    919591992005-03-22  smeghead
    9196     * New TrustedUpdate component for signing/verifying files with a DSA 
     9200    * New TrustedUpdate component for signing/verifying files with a DSA
    91979201      signature.
    91989202
    919992032005-03-21  jrandom
    9200     * Fixed the tunnel fragmentation handler to deal with multiple fragments 
    9201       in a single message properly (rather than release the buffer into the 
     9204    * Fixed the tunnel fragmentation handler to deal with multiple fragments
     9205      in a single message properly (rather than release the buffer into the
    92029206      cache after processing the first one) (duh!)
    9203     * Added the batching preprocessor which will bundle together multiple 
    9204       small messages inside a single tunnel message by delaying their delivery 
    9205       up to .5s, or whenever the pending data will fill a full message, 
     9207    * Added the batching preprocessor which will bundle together multiple
     9208      small messages inside a single tunnel message by delaying their delivery
     9209      up to .5s, or whenever the pending data will fill a full message,
    92069210      whichever comes first.  This is disabled at the moment, since without the
    92079211      above bugfix widely deployed, lots and lots of messages would fail.
    92089212    * Within each tunnel pool, stick with a randomly selected peer for up to
    92099213      .5s before randomizing and selecting again, instead of randomizing the
    9210       pool each time a tunnel is needed. 
     9214      pool each time a tunnel is needed.
    92119215
    92129216* 2005-03-18  0.5.0.3 released
     
    92199223      RESET packet along side the final resend (duh)
    92209224    * Add irc.postman.i2p to the default list of IRC servers for new installs
    9221     * Drop support for routers running 0.5 or 0.5.0.1 while maintaining 
     9225    * Drop support for routers running 0.5 or 0.5.0.1 while maintaining
    92229226      backwards compatability for users running 0.5.0.2.
    92239227
     
    92279231
    922892322005-03-17  jrandom
    9229     * Update the old speed calculator and associated profile data points to 
    9230       use a non-tiered moving average of the tunnel test time, avoiding the 
    9231       freshness issues of the old tiered speed stats. 
     9233    * Update the old speed calculator and associated profile data points to
     9234      use a non-tiered moving average of the tunnel test time, avoiding the
     9235      freshness issues of the old tiered speed stats.
    92329236    * Explicitly synchronize all of the methods on the PRNG, rather than just
    92339237      the feeder methods (sun and kaffe only need the feeder, but it seems ibm
    92349238      needs all of them synchronized).
    92359239    * Properly use the tunnel tests as part of the profile stats.
    9236     * Don't flood the jobqueue with sequential persist profile tasks, but 
     9240    * Don't flood the jobqueue with sequential persist profile tasks, but
    92379241      instead, inject a brief scheduling delay between them.
    92389242    * Reduce the TCP connection establishment timeout to 20s (which is still
     
    92439247
    924492482005-03-16  jrandom
    9245     * Adjust the old speed calculator to include end to end RTT data in its 
     9249    * Adjust the old speed calculator to include end to end RTT data in its
    92469250      estimates, and use that as the primary speed calculator again.
    9247     * Use the mean of the high capacity speeds to determine the fast 
     9251    * Use the mean of the high capacity speeds to determine the fast
    92489252      threshold, rather than the median.  Perhaps we should use the mean of
    92499253      all active non-failing peers?
     
    92549258    * New strict speed calculator that goes off the actual number of messages
    92559259      verifiably sent through the peer by way of tunnels.  Initially, this only
    9256       contains the successful message count on inbound tunnels, but may be 
    9257       augmented later to include verified outbound messages, peers queried in 
     9260      contains the successful message count on inbound tunnels, but may be
     9261      augmented later to include verified outbound messages, peers queried in
    92589262      the netDb, etc.  The speed calculation decays quickly, but should give
    9259       a better differential than the previous stat (both values are shown on 
     9263      a better differential than the previous stat (both values are shown on
    92609264      the /profiles.jsp page)
    92619265
    926292662005-03-11  jrandom
    9263     * Rather than the fixed resend timeout floor (10s), use 10s+RTT as the 
     9267    * Rather than the fixed resend timeout floor (10s), use 10s+RTT as the
    92649268      minimum (increased on resends as before, of course).
    9265     * Always prod the clock update listeners, even if just to tell them that 
     9269    * Always prod the clock update listeners, even if just to tell them that
    92669270      the time hasn't changed much.
    92679271    * Added support for explicit peer selection for individual tunnel pools,
     
    92749278    * Always give the end to end data message the explicit timeout (though the
    92759279      old default was sufficient before)
    9276     * No need to give end to end messages an insane expiration (+2m), as we 
     9280    * No need to give end to end messages an insane expiration (+2m), as we
    92779281      are already handling skew on the receiving side.
    92789282    * Don't complain too loudly about expired TunnelCreateMessages (at least,
     
    92989302      as we do with the session options.  This way people can (and should) set
    92999303      the irc proxy to interactive and the eepproxy to bulk.
    9300     * Added a startRouter.sh script to new installs which simply calls 
     9304    * Added a startRouter.sh script to new installs which simply calls
    93019305      "sh i2prouter start".  This should make it clear how people should start
    93029306      I2P.
     
    930593092005-03-04  jrandom
    93069310    * Filter HTTP response headers in the eepproxy, forcing Connection: close
    9307       so that broken (/malicious) webservers can't allow persistent 
    9308       connections.  All HTTP compliant browsers should now always close the 
     9311      so that broken (/malicious) webservers can't allow persistent
     9312      connections.  All HTTP compliant browsers should now always close the
    93099313      socket.
    93109314    * Enabled the GZIPInputStream's cache (they weren't cached before)
     
    93139317
    931493182005-03-03  jrandom
    9315     * Loop while starting up the I2PTunnel instances, in case the I2CP 
     9319    * Loop while starting up the I2PTunnel instances, in case the I2CP
    93169320      listener isn't up yet (thanks detonate!)
    93179321    * Implement custom reusable GZIP streams to both reduce memory churn
    93189322      and prevent the exposure of data in the standard GZIP header (creation
    9319       time, OS, etc).  This is RFC1952 compliant, and backwards compatible, 
     9323      time, OS, etc).  This is RFC1952 compliant, and backwards compatible,
    93209324      though has only been tested within the confines of I2P's compression use
    93219325      (DataHelper.[de]compress).
     
    93249328
    932593292005-03-02  jrandom
    9326     * Fix one substantial OOM cause (session tag manager was only dropping 
    9327       tags once the critical limit was met, rather than honoring their 
     9330    * Fix one substantial OOM cause (session tag manager was only dropping
     9331      tags once the critical limit was met, rather than honoring their
    93289332      expiration) (duh)
    93299333    * Lots of small memory fixes
     
    93349338    * Synchronized a message handling point in the SDK (even though its use is
    93359339      already essentially single threaded, its better to play it safe)
    9336     * Don't add new RepublishLeaseSetJobs on failure, just requeue up the 
     9340    * Don't add new RepublishLeaseSetJobs on failure, just requeue up the
    93379341      existing one (duh)
    9338     * Throttle the number of concurrent pending tunnel builds across all 
    9339       pools, in addition to simply throttling the number of new requests per 
    9340       minute for each pool individually.  This should avoid the cascading 
    9341       failure when tunnel builds take too long, as no new builds will be 
     9342    * Throttle the number of concurrent pending tunnel builds across all
     9343      pools, in addition to simply throttling the number of new requests per
     9344      minute for each pool individually.  This should avoid the cascading
     9345      failure when tunnel builds take too long, as no new builds will be
    93429346      created until the previous ones are handled.
    9343     * Factored out and extended the DataHelper's unit tests for dealing with 
     9347    * Factored out and extended the DataHelper's unit tests for dealing with
    93449348      long and date formatting.
    9345     * Explicitly specify the HTTP auth realm as "i2prouter", though this 
     9349    * Explicitly specify the HTTP auth realm as "i2prouter", though this
    93469350      alone doesn't address the bug where jetty asks for authentication too
    93479351      much.  (thanks orion!)
     
    936093642005-02-26  jrandom
    93619365    * Further streaming lib caching improvements
    9362     * Reduce the minimum RTT (used to calculate retry timeouts), but also 
     9366    * Reduce the minimum RTT (used to calculate retry timeouts), but also
    93639367      increase the RTT on resends.
    93649368    * Lower the default message size to 4KB from 16KB to further reduce the
     
    93719375
    937293762005-02-24  jrandom
    9373     * Throttle the number of tunnel rebuilds per minute, preventing CPU 
     9377    * Throttle the number of tunnel rebuilds per minute, preventing CPU
    93749378      overload under catastrophic failures (thanks Tracker and cervantes!)
    93759379    * Block the router startup process until we've initialized the clock
     
    93819385      stream if the ACK to their SYN was lost.
    93829386
    9383 2005-02-23  jrandom 
     93872005-02-23  jrandom
    93849388    * Now that we don't get stale SAM sessions, it'd be nice if we didn't
    93859389      get stale tunnel pools, don't you think?
     
    93889392
    938993932005-02-22  jrandom
    9390     * Reworked the tunnel (re)building process to remove the tokens and 
     9394    * Reworked the tunnel (re)building process to remove the tokens and
    93919395      provide cleaner controls on the tunnels built.
    93929396    * Fixed situations where the timestamper wanted to test more servers than
     
    940294062005-02-22  jrandom
    94039407    * Adjusted (and fixed...) the timestamper change detection
    9404     * Deal with a rare reordering bug at the beginning of a stream (so we 
     9408    * Deal with a rare reordering bug at the beginning of a stream (so we
    94059409      don't drop it unnecessarily)
    94069410    * Cleaned up some dropped message handling in the router
    94079411    * Reduced job queue churn when dealing with a large number of tunnels by
    94089412      sharing an expiration job
    9409     * Keep a separate list of the most recent CRIT messages (shown on the 
     9413    * Keep a separate list of the most recent CRIT messages (shown on the
    94109414      logs.jsp).  This way they don't get buried among any other messages.
    9411     * For clarity, display the tunnel variance config as "Randomization" on 
     9415    * For clarity, display the tunnel variance config as "Randomization" on
    94129416      the web console.
    9413     * If lease republishing fails (boo! hiss!) try it again 
     9417    * If lease republishing fails (boo! hiss!) try it again
    94149418    * Actually fix the negative jobLag in the right place (this time)
    94159419    * Allow reseeding when there are less than 10 known peer references
     
    94349438    * Properly implement the selectNotFailingPeers so that we get a random
    94359439      selection of peers, rather than using the strictOrdering (thanks dm!)
    9436     * Don't include too many "don't tell me about" peer references in the 
     9440    * Don't include too many "don't tell me about" peer references in the
    94379441      lookup message - only send the 10 peer references closest to the target.
    94389442
     
    94479451    * Cleaned up some closing event issues on the streaming lib
    94489452    * Stop bundling the jetty 5.1.2 and updated wrapper.config in the update
    9449       so that 0.4.* users will need to do a clean install, but we don't need 
     9453      so that 0.4.* users will need to do a clean install, but we don't need
    94509454      to shove an additional 2MB in each update to those already on 0.5.
    94519455    * Imported the susimail css (oops, thanks susi!)
     
    94639467    * Fixed the braindead tunnel testing logic
    94649468    * If a large number of tunnels are failing (within the last 5-10 minutes)
    9465       and the current tunnel pool's configuration allows it, randomly build a 
     9469      and the current tunnel pool's configuration allows it, randomly build a
    94669470      zero hop tunnel to replace failed tunnels.
    94679471    * Enable postman's POP3 and SMTP tunnels by default
     
    94719475      realistic capacity, dropping a random chunk of received tag sets and
    94729476      conducting some minor analysis of the remaining ones.  This is a part
    9473       of a pretty serious error condition, and logs as CRIT (if/when people 
     9477      of a pretty serious error condition, and logs as CRIT (if/when people
    94749478      see "TOO MANY SESSION TAGS!", please let me know the full log line it
    94759479      puts in the wrapper.log or /logs.jsp)
     
    94829486    * Replaced the old tunnel routing crypto with the one specified in
    94839487      router/doc/tunnel-alt.html, including updates to the web console to view
    9484       and tweak it. 
    9485     * Provide the means for routers to reject tunnel requests with a wider 
     9488      and tweak it.
     9489    * Provide the means for routers to reject tunnel requests with a wider
    94869490      range of responses:
    94879491        probabalistic rejection, due to approaching overload
     
    94969500        inbound.backupQuantity (# of tunnels to keep in the ready)
    94979501        inbound.length (# of remote peers in the tunnel)
    9498         inbound.lengthVariance (if > 0, permute the length by adding a random # 
     9502        inbound.lengthVariance (if > 0, permute the length by adding a random #
    94999503                                up to the variance.  if < 0, permute the length
    9500                                 by adding or subtracting a random # up to the 
     9504                                by adding or subtracting a random # up to the
    95019505                                variance)
    95029506        outbound.* (same as the inbound, except for the, uh, outbound tunnels
     
    95119515      max window size.
    95129516    * Reduced the default streaming lib max message size to 16KB (though still
    9513       configurable by the user), also doubling the default maximum window 
     9517      configurable by the user), also doubling the default maximum window
    95149518      size.
    95159519    * Replaced the RouterIdentity in a Lease with its SHA256 hash.
     
    95189522    * Added a new "netId" flag to let routers drop references to other routers
    95199523      who we won't be able to talk to.
    9520     * Extended the timestamper to get a second (or third) opinion whenever it 
     9524    * Extended the timestamper to get a second (or third) opinion whenever it
    95219525      wants to actually adjust the clock offset.
    9522     * Replaced that kludge of a timestamp I2NP message with a full blown 
     9526    * Replaced that kludge of a timestamp I2NP message with a full blown
    95239527      DateMessage.
    95249528    * Substantial memory optimizations within the router and the SDK to reduce
    9525       GC churn.  Client apps and the streaming libs have not been tuned, 
     9529      GC churn.  Client apps and the streaming libs have not been tuned,
    95269530      however.
    95279531    * More bugfixes than you can shake a stick at.
    95289532
    952995332005-02-13  jrandom
    9530     * Updated jbigi source to handle 64bit CPUs.  The bundled jbigi.jar still 
    9531       only contains 32bit versions, so build your own, placing libjbigi.so in 
     9534    * Updated jbigi source to handle 64bit CPUs.  The bundled jbigi.jar still
     9535      only contains 32bit versions, so build your own, placing libjbigi.so in
    95329536      your install dir if necessary.  (thanks mule!)
    95339537    * Added support for libjbigi-$os-athlon64 to NativeBigInteger and CPUID
     
    95819585
    958295862005-01-23  smeghead
    9583     * Port the java SAM client library to mono/C# and released into the 
     9587    * Port the java SAM client library to mono/C# and released into the
    95849588      public domain.  The 0.1 version of this port is available in CVS as
    95859589      i2p/apps/sam/csharp/src/I2P.SAM.Client.  The other nonfunctional C#
     
    960096042005-01-17  jrandom
    96019605    * Added meaningful support for adjusting the preferred message size in the
    9602       streaming lib by setting the i2p.streaming.maxMessageSize=32768 (or 
     9606      streaming lib by setting the i2p.streaming.maxMessageSize=32768 (or
    96039607      whatever).  The other side will mimic a reduction (but never an increase).
    9604     * Always make sure to use distinct ConnectionOption objects for each 
     9608    * Always make sure to use distinct ConnectionOption objects for each
    96059609      connection (duh)
    96069610    * Reduced the default ACK delay to 500ms on in the streaming lib
     
    96109614
    961196152005-01-15  cervantes
    9612     * Added support to the eepproxy for URLs such as 
     9616    * Added support to the eepproxy for URLs such as
    96139617      http://localhost:4444/eepproxy/foo.i2p/bar/baz or even
    96149618      http://localhost:4444/eepproxy/foo.i2p/?i2paddresshelper=base64
    96159619
    961696202005-01-15  jrandom
    9617     * Caught a series of (previously unhandled) errors caused by requeueing 
     9621    * Caught a series of (previously unhandled) errors caused by requeueing
    96189622      messages that had timed out on the TCP transport (thanks mae^!)
    96199623    * Reduce the barrier to dropping session tags on streaming lib resends -
     
    963296362005-01-05  jrandom
    96339637    * Handle unexpected network read errors more carefully (thanks parg!)
    9634     * Added more methods to partially compare (DataHelper) and display 
     9638    * Added more methods to partially compare (DataHelper) and display
    96359639      arrays (Base64.encode).
    96369640    * Exposed the AES encryptBlock/decryptBlock on the context.aes()
    96379641    * Be more generous on the throttle when just starting up the router
    96389642    * Fix a missing scheduled event in the streaming lib (caused after reset)
    9639     * Add a new DisconnectListener on the I2PSocketManager to allow 
     9643    * Add a new DisconnectListener on the I2PSocketManager to allow
    96409644      notification of session destruction.
    96419645    * Make sure our own router identity is valid, and if it isn't, build a new
    9642       one and restart the router.  Alternately, you can run the Router with 
     9646      one and restart the router.  Alternately, you can run the Router with
    96439647      the single command line argument "rebuild" and it will do the same.
    96449648
    964596492004-12-31  ragnarok
    9646     * Integrated latest addressbook changes (2.0.3) which include support for 
     9650    * Integrated latest addressbook changes (2.0.3) which include support for
    96479651      deploying as a .war file with no existing addressbook configuration.
    9648     * Updated main build process to bundle the addressbook.war in the 
     9652    * Updated main build process to bundle the addressbook.war in the
    96499653      i2pinstall.jar and i2pupdate.zip.
    96509654
     
    96559659
    965696602004-12-30  jrandom
    9657     * Revised the I2PTunnel client and httpclient connection establishment 
     9661    * Revised the I2PTunnel client and httpclient connection establishment
    96589662      throttles.  There is now a pool of threads that build the I2PSocket
    9659       connections with a default size of 5, configurable via the I2PTunnel 
     9663      connections with a default size of 5, configurable via the I2PTunnel
    96609664      client option 'i2ptunnel.numConnectionBuilders' (if set to 0, it will
    96619665      not throttle the number of concurrent builders, but will launch a thread
     
    967296762004-12-29  jrandom
    96739677    * Add in a new keepalive event on each TCP connection, proactively sending
    9674       a (tiny) time message every minute or two, as well as killing the 
    9675       connection if no message has been fully sent within 5 minutes or so. 
     9678      a (tiny) time message every minute or two, as well as killing the
     9679      connection if no message has been fully sent within 5 minutes or so.
    96769680      This should help deal with hung connections from IP address changes.
    96779681
     
    96919695    * Cleaned up the postinstall/startup scripts a bit more to handle winME,
    96929696      and added windows info to the headless docs. (thanks ardvark!)
    9693     * Fixed a harmless (yet NPE inspiring) race during the final shutdown of 
     9697    * Fixed a harmless (yet NPE inspiring) race during the final shutdown of
    96949698      a stream (thanks frosk!)
    9695     * Add a pair of new stats for monitoring tunnel participation - 
     9699    * Add a pair of new stats for monitoring tunnel participation -
    96969700      tunnel.participatingBytesProcessed (total # bytes transferred) and
    96979701      tunnel.participatingBytesProcessedActive (total # bytes transferred for
    9698       tunnels whose byte count exceed the 10m average).  This should help 
     9702      tunnels whose byte count exceed the 10m average).  This should help
    96999703      further monitor congestion issues.
    97009704    * Made the NamingService factory property public (thanks susi!)
     
    97109714
    971197152004-12-19  jrandom
    9712     * Added three new stats - router.activePeers, router.fastPeers, and 
     9716    * Added three new stats - router.activePeers, router.fastPeers, and
    97139717      router.highCapacityPeers, updated every minute
    97149718
     
    97169720    * Added a new i2ptunnel type: 'httpserver', allowing you to specify what
    97179721      hostname should be sent to the webserver.  By default, new installs will
    9718       have an httpserver pointing at their jetty instance with the spoofed 
     9722      have an httpserver pointing at their jetty instance with the spoofed
    97199723      name 'mysite.i2p' (editable on the /i2ptunnel/edit.jsp page).
    97209724
     
    97289732    * Catch another oddball case for a reset connection in the streaming lib.
    97299733    * Add a dumpprofile.jsp page, called with ?peer=base64OfPeerHash, which
    9730       dumps the current state of that peer's profile.  Instead of the full 
     9734      dumps the current state of that peer's profile.  Instead of the full
    97319735      base64, you can pass in however many characters you have and it will
    97329736      return the first match found.
     
    97369740      we now accept the request if we've allocated less than our limit
    97379741      and reject it if we've allocated more.
    9738     * Stick to the standard capacity scale on tunnel rejection, even for 
     9742    * Stick to the standard capacity scale on tunnel rejection, even for
    97399743      the 10m period.
    97409744    * Build the time message at the very last possible moment
     
    97479751      the stat 'tcp.disconnectAfterSkew'.
    97489752    * Fixed the formatting in the skew display
    9749     * Added an ERROR message that is fired once after we run out of 
     9753    * Added an ERROR message that is fired once after we run out of
    97509754      routerInfo files (thanks susi!)
    97519755    * Set the connect timeout equal to the streaming lib's disconnect timeout
     
    97549758    * Fix for another connection startup problem in the streaming lib.
    97559759    * Fix for a stupid error in the probabalistic drop (rand <= P, not > P)
    9756     * Adjust the capacity calculations so that tunnel failures alone in the 
     9760    * Adjust the capacity calculations so that tunnel failures alone in the
    97579761      last 10m will not trigger a 0 capacity rank.
    97589762
    975997632004-12-14  jrandom
    97609764    * Periodically send a message along all I2NP connections with the router's
    9761       current time, allowing the receiving peer to determine that the clock 
     9765      current time, allowing the receiving peer to determine that the clock
    97629766      has skewed too much, and hence, disconnect.  For backwards compatability
    97639767      reasons, this is being kludged into a DeliveryStatusMessage (ewww).  The
     
    97739777      (or whatever) and the drop code can be disabled with the parameter
    97749778      'tcp.dropProbabalistically=false'.
    9775     * Still penalize a peer on tunnel failure, but don't immediately drop 
     9779    * Still penalize a peer on tunnel failure, but don't immediately drop
    97769780      their capacity to 0.
    97779781    * More aggressively ACK duplicates
     
    97849788    * Added some error checking on the new client send job (thanks duck!)
    97859789    * Implemented tunnel rejection based on bandwidth usage (rejecting tunnels
    9786       proportional to the bytes allocated in existing tunnels vs the bytes 
     9790      proportional to the bytes allocated in existing tunnels vs the bytes
    97879791      allowed through the bandwidth limiter).
    9788     * Enable a new configuration parameter for triggering a tunnel rebuild 
     9792    * Enable a new configuration parameter for triggering a tunnel rebuild
    97899793      (tunnel.maxTunnelFailures), where that is the max allowed test failures
    97909794      before killing the tunnel (default 0).
    97919795    * Gather more data that we rank capacity by (now we monitor and balance the
    97929796      data from 10m/30m/60m/1d instead of just 10m/60m/1d).
    9793     * Fix a truncation/type conversion problem on the long term capacity 
     9797    * Fix a truncation/type conversion problem on the long term capacity
    97949798      values (we were ignoring the daily stats outright)
    97959799
     
    98039807
    980498082004-12-11  jrandom
    9805     * Use a simpler and less memory intensive job for processing outbound 
    9806       client messages when the session is in mode=bestEffort.  We can 
    9807       immediately discard the data as soon as its sent the first time, 
     9809    * Use a simpler and less memory intensive job for processing outbound
     9810      client messages when the session is in mode=bestEffort.  We can
     9811      immediately discard the data as soon as its sent the first time,
    98089812      rather than wait for an ack, since we will never internally resend.
    98099813    * Reduce some synchronization to avoid a rare deadlock
     
    98169820
    981798212004-12-08  jrandom
    9818     * Revised the buffering when reading from the SAM client and writing 
     9822    * Revised the buffering when reading from the SAM client and writing
    98199823      to the stream.  Also added a thread (sigh) so we don't block the
    98209824      SAM client from giving us more messages for abnormally long periods
     
    98249828
    982598292004-12-06  jrandom
    9826     * Don't do a 'passive flush' while there are already outbound messages 
     9830    * Don't do a 'passive flush' while there are already outbound messages
    98279831      unacked.
    9828     * Show the reseed link if up to 10 peers profiles are active (thanks 
     9832    * Show the reseed link if up to 10 peers profiles are active (thanks
    98299833      dburton!)
    98309834
     
    98399843
    984098442004-12-05  jrandom
    9841     * Default the I2CP listener to localhost only, unless overridden by 
     9845    * Default the I2CP listener to localhost only, unless overridden by
    98429846      i2cp.tcp.bindAllInterfaces=true (thanks dm!)
    98439847    * More SAM fixes for things recently broken (whee)
     
    98519855
    985298562004-12-05  jrandom
    9853     * Fixed some links in the console (thanks ugha!) and the javadoc 
     9857    * Fixed some links in the console (thanks ugha!) and the javadoc
    98549858      (thanks dinoman!)
    98559859    * Fix the stream's passive flush timer (oh, its supposed to work?)
     
    985798612004-12-03  jrandom
    98589862    * Toss in a small pool of threads (3) to execute the events queued up with
    9859       the SimpleTimer, as we do currently see the occational event 
     9863      the SimpleTimer, as we do currently see the occational event
    98609864      notification spiking up to a second or so.
    98619865    * Implement a SAM client API in java, useful for event based streaming (or
    98629866      for testing the SAM bridge)
    9863     * Added support to shut down the SAM bridge on OOM (useful if the SAM 
     9867    * Added support to shut down the SAM bridge on OOM (useful if the SAM
    98649868      bridge is being run outside of the router).
    98659869    * Include the SAM test code in the sam.jar
    9866     * Remove an irrelevent warning message from SAM, which was caused by 
     9870    * Remove an irrelevent warning message from SAM, which was caused by
    98679871      perfectly normal operation due to a session being closed.
    9868     * Removed some unnecessary synchronization in the streaming lib's 
     9872    * Removed some unnecessary synchronization in the streaming lib's
    98699873      PacketQueue
    9870     * More quickly clean up the memory used by the streaming lib by 
     9874    * More quickly clean up the memory used by the streaming lib by
    98719875      immediately killing each packet's resend job as soon as it is ACKed (or
    9872       cancelled), so that there are no longer any valid pointers to the 
     9876      cancelled), so that there are no longer any valid pointers to the
    98739877      (potentially 32KB) packet.
    98749878    * Fixed the timestamps dumped to stdout when debugging the PacketHandler.
    9875     * Drop packets that would expand our inbound window beyond our maximum 
     9879    * Drop packets that would expand our inbound window beyond our maximum
    98769880      buffer size (default 32 messages)
    98779881    * Always read the ACK/NACK data from the verified packets received, even
     
    98909894
    989198952004-12-01  jrandom
    9892     * Fixed a stupid typo that inadvertantly allowed persistent HTTP 
     9896    * Fixed a stupid typo that inadvertantly allowed persistent HTTP
    98939897      connections to work (thanks duck!)
    98949898    * Make sure we override the inactivity timeout too
     
    98999903    * Strip out any of the Accept-* HTTP header lines, and always make sure to
    99009904      include the forged User-agent header.
    9901     * Adjust the default read timeout on the eepproxy to 60s, unless 
     9905    * Adjust the default read timeout on the eepproxy to 60s, unless
    99029906      overridden.
    99039907    * Minor tweak on stream shutdown.
     
    99079911    * Build in a simple timeout to flush data queued into the I2PSocket but
    99089912      not yet flushed.
    9909     * Don't explicitly flush after each SAM stream write, but leave it up to 
     9913    * Don't explicitly flush after each SAM stream write, but leave it up to
    99109914      the [nonblocking] passive flush.
    99119915    * Don't whine about 10-99 connection events occurring in a second
     
    99229926    * Reduced contention for local client delivery
    99239927    * Drop the new code that munges the wrapper.config.  Instead, updates that
    9924       need to change it will include their own wrapper.config in the 
    9925       i2pupdate.zip, overwriting the existing file.  If the file 
     9928      need to change it will include their own wrapper.config in the
     9929      i2pupdate.zip, overwriting the existing file.  If the file
    99269930      "wrapper.config.updated" is included, it is deleted at first opportunity
    9927       and the router shut down, displaying a notice that the router must be 
     9931      and the router shut down, displaying a notice that the router must be
    99289932      started again cleanly to allow the changes to the wrapper.config to take
    99299933      effect.
    9930     * Properly stop accept()ing I2PSocket connections if we close down the 
     9934    * Properly stop accept()ing I2PSocket connections if we close down the
    99319935      session (duh).
    99329936    * Make sure we cancel any outstanding Packets in flight when a connection
     
    99379941    * Accept IP address detection changes with a 2-out-of-3 minimum.
    99389942    * As long as the router is up, keep retrying to bind the I2CP listener.
    9939     * Decrease the java service wrapper ping frequency to once every 10 
     9943    * Decrease the java service wrapper ping frequency to once every 10
    99409944      minutes, rather than once every 5 seconds.
    99419945
    994299462004-11-27  jrandom
    9943     * Some cleanup and bugfixes for the IP address detection code where we 
     9947    * Some cleanup and bugfixes for the IP address detection code where we
    99449948      only consider connections that have actually sent and received messages
    9945       recently as active, rather than the mere presence of a TCP socket as 
     9949      recently as active, rather than the mere presence of a TCP socket as
    99469950      activity.
    99479951
     
    99629966
    996399672004-11-26  jrandom
    9964     * Enable the new streaming lib as the default.  That means, for any 
    9965       substantial definition, it is NOT BACKWARDS COMPATIBLE. 
     9968    * Enable the new streaming lib as the default.  That means, for any
     9969      substantial definition, it is NOT BACKWARDS COMPATIBLE.
    99669970
    996799712004-11-25  jrandom
     
    99769980      offsets, not the offset itself (duh)
    99779981    * Router console html update
    9978     * New (and uuuuugly) code to verify that the wrapper.config contains 
     9982    * New (and uuuuugly) code to verify that the wrapper.config contains
    99799983      the necessary classpath entries on update.  If it has to update the
    99809984      wrapper.config, it will stop the JVM and service completely, since the
     
    99899993
    999099942004-11-21  jrandom
    9991     * Update the I2PTunnel web interface to include an option for the new 
     9995    * Update the I2PTunnel web interface to include an option for the new
    99929996      streaming lib (which is ignored until the 0.4.2 release).
    9993     * Revised the I2PTunnel web interface to keep the I2CP options of client 
     9997    * Revised the I2PTunnel web interface to keep the I2CP options of client
    99949998      and httpclient tunnels in sync, as they all share the same I2CP session.
    99959999
     
    1001210016      target destinations (e.g. 'client 6668 irc.duck.i2p,irc.baffled.i2p')
    1001310017    * Add a quick link on the left hand nav to reseed if there aren't enough
    10014       known peers, as well as link to the config page if there are no active 
     10018      known peers, as well as link to the config page if there are no active
    1001510019      peers.  Revised config page accordingly.
    1001610020
    10017100212004-11-21  jrandom
    10018     * Destroy ElGamal/AES+SessionTag keys after 15 minutes of inactivity 
     10022    * Destroy ElGamal/AES+SessionTag keys after 15 minutes of inactivity
    1001910023      rather that every 15 minutes, and increase the warning period in which
    1002010024      we refresh tags from 30s to 2 minutes.
     
    1002310027
    10024100282004-11-19  jrandom
    10025     * Off-by-one fix to the tunnel pool management code, along side some 
     10029    * Off-by-one fix to the tunnel pool management code, along side some
    1002610030      explicit initialization.  This can affect clients whose lengths are
    1002710031      shorter than the router's default (thanks duck!)
     
    10048100522004-11-13  jrandom
    1004910053    * Added throttles on how many I2PTunnel client connections we open at once
    10050     * Replaced some buffered streams in I2PTunnel with unbuffered streams, as 
     10054    * Replaced some buffered streams in I2PTunnel with unbuffered streams, as
    1005110055      the streaming library used should take care of any buffering.
    1005210056    * Added a cache for some objects used in I2PTunnel, especially useful when
     
    1005510059
    10056100602004-11-10  jrandom
    10057     * Allow loading the (mini)streaming connection options from the 
     10061    * Allow loading the (mini)streaming connection options from the
    1005810062      environment.
    1005910063    * More defensive programming in the DSA implementation.
    1006010064
    10061100652004-11-08  jrandom
    10062     * Remove spurious flush calls from I2PTunnel, and work with the 
     10066    * Remove spurious flush calls from I2PTunnel, and work with the
    1006310067      I2PSocket's output stream directly (as the various implementations
    1006410068      do their own buffering).
     
    1007510079
    10076100802004-11-06  jrandom
    10077     * Expose a drop down on the /configclients.jsp to enter the outbound 
     10081    * Expose a drop down on the /configclients.jsp to enter the outbound
    1007810082      tunnel depth.
    1007910083    * Improved *hosts.txt loading
    10080     * Explicitly override the JVM's timezone settings to use GMT so that 
     10084    * Explicitly override the JVM's timezone settings to use GMT so that
    1008110085      any client applications which use timezones won't leak sensitive
    1008210086      data (thanks gott!)
     
    1008410088
    10085100892004-11-06  jrandom
    10086     * Fix for a long standing synchronization bug in the SDK that in rare 
     10090    * Fix for a long standing synchronization bug in the SDK that in rare
    1008710091      instances can add a few seconds of lag.
    1008810092
     
    1010110105
    10102101062004-11-02  jrandom
    10103     * Fixed up the configuration overrides for the streaming socket lib 
     10107    * Fixed up the configuration overrides for the streaming socket lib
    1010410108      integration so that it properly honors env settings.
    1010510109    * More memory usage streamlining (last major revamp for now, i promise)
     
    1011210116      serialization for SHA256 calculation, logging, and both I2CP and I2NP
    1011310117      message handling.
    10114     * Fix some situations where we forward messages too eagerly.  For a 
    10115       request at the tunnel endpoint, if the tunnel is inbound and the target 
     10118    * Fix some situations where we forward messages too eagerly.  For a
     10119      request at the tunnel endpoint, if the tunnel is inbound and the target
    1011610120      is remote, honor the message by tunnel routing the data rather than
    1011710121      sending it directly to the requested location.
     
    1012610130      only those, not those plus a new set (otherwise we aren't sure on ACK
    1012710131      which set was delivered)
    10128     * Allow configuration for the partial send timeout (how long before 
     10132    * Allow configuration for the partial send timeout (how long before
    1012910133      resending a message down a different tunnel in a lease).  This can be
    1013010134      updated with the "router.clientPartialSendTimeout" router config prop.
     
    1013210136
    10133101372004-10-29  jrandom
    10134     * Strip the Referer, Via, and From headers completely, rather than 
     10138    * Strip the Referer, Via, and From headers completely, rather than
    1013510139      inserting a bogus value ("i2p").  This should help with the use of
    1013610140      SnipSnap and Geeklog (thanks nickster and DrWoo!)
     
    1015110155    * Handle client errors when notifying them of message availability.
    1015210156    * New StreamSinkSend which sends a file to a destination and disconnects.
    10153     * Update the I2PSocketManagerFactory to build the specific 
     10157    * Update the I2PSocketManagerFactory to build the specific
    1015410158      I2PSocketManager instance based on the "i2p.streaming.manager" property,
    1015510159      containing the class name of the I2PSocketManager to instantiate.
     
    1017310177      failing so that we move off them quicker.
    1017410178    * Simplify some data structure serialization for reuse in the streaming
    10175       lib, as well as add support for signing and verifying partial byte 
     10179      lib, as well as add support for signing and verifying partial byte
    1017610180      arrays.
    1017710181    * Logging updates
     
    1018010184    * Increased the default minimum tunnel test time to 5 seconds, since we
    1018110185      still see the occational message processing time spike to 2 seconds.
    10182     * Update the SimpleTimer to allow rescheduling a task thats already 
     10186    * Update the SimpleTimer to allow rescheduling a task thats already
    1018310187      queued (useful for the new streaming lib).
    1018410188
     
    1020110205    * Adjust the tunnel test timeouts dynamically - rather than the old
    1020210206      flat 30s (!!!) timeout, we set the timeout to 2x the average tunnel
    10203       test time (the deviation factor can be adjusted by setting 
     10207      test time (the deviation factor can be adjusted by setting
    1020410208      "router.tunnelTestDeviation" to "3.0" or whatever).  This should help
    1020510209      find the 'good' tunnels.
     
    1020710211
    10208102122004-10-13  jrandom
    10209     * Fix the probabalistic tunnel reject (we always accepted everything, 
     10213    * Fix the probabalistic tunnel reject (we always accepted everything,
    1021010214      since the docs on java.util.Random.nextDouble() are wrong..)
    1021110215    * Fixed a race on startup (thanks Quadn!)
     
    1021410218    * Disable the probabalistic drop by default (enable via the router config
    1021510219      property "tcp.dropProbabalistically=true")
    10216     * Disable the actual watchdog shutdown by default, but keep track of more 
    10217       variables and log a lot more when it occurs (enable via the router 
     10220    * Disable the actual watchdog shutdown by default, but keep track of more
     10221      variables and log a lot more when it occurs (enable via the router
    1021810222      config property "watchdog.haltOnHang=true")
    10219     * Implement some tunnel participation smoothing by refusing requests 
     10223    * Implement some tunnel participation smoothing by refusing requests
    1022010224      probabalistically as our participating tunnel count exceeds the previous
    10221       hour's, or when the 10 minute average tunnel test time exceeds the 60 
    10222       minute average tunnel test time.  The probabilities in both cases are 
     10225      hour's, or when the 10 minute average tunnel test time exceeds the 60
     10226      minute average tunnel test time.  The probabilities in both cases are
    1022310227      oldAverage / #current, so if you're suddenly flooded with 200 tunnels
    1022410228      and you had previously only participated in 50, you'll have a 25% chance
     
    1023210236
    10233102372004-10-09  jrandom
    10234     * Added a watchdog timer to do some baseline liveliness checking to help 
     10238    * Added a watchdog timer to do some baseline liveliness checking to help
    1023510239      debug some odd errors.
    1023610240    * Added a pair of summary stats for bandwidth usage, allowing easy export
     
    1023910243
    10240102442004-10-08  jrandom
    10241     * Revamp the AESInputStream so it doesn't allocate any temporary objects 
     10245    * Revamp the AESInputStream so it doesn't allocate any temporary objects
    1024210246      during its operation.
    1024310247
     
    1024510249    * Don't kill the establisher threads during a soft restart.
    1024610250    * Attempt to validate the peer's routerInfo earlier during handshaking.
    10247     * Revamp the AESOutputStream so it doesn't allocate any temporary objects 
     10251    * Revamp the AESOutputStream so it doesn't allocate any temporary objects
    1024810252      during its operation.
    1024910253
     
    1025210256      There is still significant GC churn, especially under load, but this
    1025310257      should help.
    10254     * Catch some oddball errors in the transport (message timeout while 
     10258    * Catch some oddball errors in the transport (message timeout while
    1025510259      establishing).
    1025610260
    10257102612004-10-07  jrandom
    1025810262    * Expire queued messages even when the writer is blocked.
    10259     * Reimplement most of the I2NP writing with less temporary memory 
     10263    * Reimplement most of the I2NP writing with less temporary memory
    1026010264      allocations (I2NP reading still gobbles memory).
    1026110265
    10262102662004-10-06  jrandom
    1026310267    * Implement an active queue management scheme on the TCP transports,
    10264       dropping messages probabalistically as the queue fills up.  The 
    10265       estimated queue capacity is determined by the rate at which messages 
    10266       have been sent to the peer (averaged at 1, 5, and 60m periods).  As 
     10268      dropping messages probabalistically as the queue fills up.  The
     10269      estimated queue capacity is determined by the rate at which messages
     10270      have been sent to the peer (averaged at 1, 5, and 60m periods).  As
    1026710271      we exceed 1/2 of the estimated capacity, we drop messages throughout
    1026810272      the queue probabalistically with regards to their size.  This is based
    10269       on RFC 2309's RED, with the minimum threshold set to 1/2 the 
     10273      on RFC 2309's RED, with the minimum threshold set to 1/2 the
    1027010274      estimated connection capacity.  We may want to consider using a send
    1027110275      rate and queue size measured across all connections, to deal with our
     
    10274102782004-10-06  jrandom
    1027510279    * Enable explicit disabling of the systray entirely for windows machines
    10276       with strange configurations: add -Dsystray.disable=true to the java 
     10280      with strange configurations: add -Dsystray.disable=true to the java
    1027710281      command line.  (thanks mihi!)
    1027810282
     
    1028810292    * Don't go into a fast busy if an I2PTunnel 'server' is explicitly killed
    1028910293      (thanks mule!)
    10290     * Handle some more error conditions regarding abruptly closing sockets 
     10294    * Handle some more error conditions regarding abruptly closing sockets
    1029110295      (thanks Jonva!)
    1029210296
    10293102972004-10-04  jrandom
    10294     * Update the shitlist to reject a peer for an exponentially increasing 
    10295       period of time (with an upper bounds of an hour). 
     10298    * Update the shitlist to reject a peer for an exponentially increasing
     10299      period of time (with an upper bounds of an hour).
    1029610300    * Various minor stat and debugging fixes
    1029710301
    10298103022004-10-03  jrandom
    10299     * Add a new stat logging component to optionally dump the raw stats to 
     10303    * Add a new stat logging component to optionally dump the raw stats to
    1030010304      disk as they are generated, rather than rely upon the summarized data.
    1030110305      By default, this is off, but the router property "stat.logFilters" can
     
    1032410328
    10325103292004-10-01  jrandom
    10326     * Explicitly refuse IPv6 addresses, since only some peers support 
     10330    * Explicitly refuse IPv6 addresses, since only some peers support
    1032710331      them and we want fully reachable peers.
    1032810332
     
    1033610340      with Jetty - simply edit ./eepsite/docroot/index.html and give people
    1033710341      the key listed on the I2PTunnel configuration page, and its up.
    10338     * Router console cleanup, and some (off by default) tunnels - 
     10342    * Router console cleanup, and some (off by default) tunnels -
    1033910343      smtp.postman.i2p (port 7659), pop.postman.i2p (port 7660), and
    1034010344      irc.baffled.i2p (port 7661)
     
    1034610350
    10347103512004-09-27  jrandom
    10348     * Limit the number of connection tags saved to 10,000.  This is a huge 
    10349       limit, but consumes no more than 1MB of RAM.  For now, we drop them 
     10352    * Limit the number of connection tags saved to 10,000.  This is a huge
     10353      limit, but consumes no more than 1MB of RAM.  For now, we drop them
    1035010354      randomly after reaching that size, forcing those dropped peers to use
    1035110355      a full DH negotiation.
     
    1035310357
    10354103582004-09-26  jrandom
    10355     * Complete rewrite of the TCP transport with IP autodetection and 
     10359    * Complete rewrite of the TCP transport with IP autodetection and
    1035610360      low CPU overhead reconnections.  More concise connectivity errors
    1035710361      are listed on the /oldconsole.jsp as well.  The IP autodetection works
    1035810362      by listening to the first person who tells you what your IP address is
    10359       when you have not defined one yourself and you have no other TCP 
     10363      when you have not defined one yourself and you have no other TCP
    1036010364      connections.
    1036110365    * Update to the I2NP message format to add transparent verification at
     
    1037910383      combinations we are connected to (rather than just the identities).  Also
    1038010384      catch a few configuration errors earlier.
    10381     * Removed no longer relevent methods from the Transport API that were 
     10385    * Removed no longer relevent methods from the Transport API that were
    1038210386      exposing ideas that probably shouldn't be exposed.
    1038310387    * Removed the 0.4.0.1 specific files from i2pupdate.zip (relating to script
     
    10386103902004-09-13  jrandom
    1038710391    * Update for the SDK reconnection to deal with overflow.
    10388     * Web improvements (@ not # on the /logs.jsp [thanks ugha!] and fixed the 
     10392    * Web improvements (@ not # on the /logs.jsp [thanks ugha!] and fixed the
    1038910393      rounding on lifetime bandwidth used [thanks gott!]).
    1039010394
     
    1039410398    * Updated the "Active:" peer count to display the # of connections as well
    1039510399      as the number of recently active router identities.
    10396     * Implement some basic updating code - on startup, if there is a file named 
     10400    * Implement some basic updating code - on startup, if there is a file named
    1039710401      "i2pupdate.zip" in the I2P installation directory, extract it, delete it,
    1039810402      then restart.
    10399     * Added an ugly little script to allow launching the router on win9x 
     10403    * Added an ugly little script to allow launching the router on win9x
    1040010404      machines without a dos box (using javaw to run a .bat file).
    1040110405    * Logging updates.
     
    10420104242004-09-07  jrandom
    1042110425    * Make sure that peers placed in the 'fast' group are ones we both know
    10422       how to reach and have been able to reach recently.  These peers may 
     10426      how to reach and have been able to reach recently.  These peers may
    1042310427      still be placed in the 'high capacity' group however (though that group
    1042410428      is only queried if the 'fast' group is too small)
     
    1043210436
    10433104372004-09-07  jrandom
    10434     * Write the native libraries to the current directory when they are loaded 
    10435       from a resource, and load them from that file on subsequent runs (in 
     10438    * Write the native libraries to the current directory when they are loaded
     10439      from a resource, and load them from that file on subsequent runs (in
    1043610440      turn, we no longer *cough* delete the running libraries...)
    1043710441    * Added support for a graceful restart.
    10438     * Added new pseudo-shutdown hook specific to the router, allowing 
     10442    * Added new pseudo-shutdown hook specific to the router, allowing
    1043910443      applications to request tasks to be run when the router shuts down.  We
    10440       use this for integration with the service manager, since otherwise a 
    10441       graceful shutdown would cause a timeout, followed by a forced hard 
     10444      use this for integration with the service manager, since otherwise a
     10445      graceful shutdown would cause a timeout, followed by a forced hard
    1044210446      shutdown.
    1044310447    * Made the capacity calculator a bit more dynamic by not outright ignoring
     
    1045710461    * Properly clear old transport addresses from being displayed on the old
    1045810462      console after soft restarts.
    10459     * Properly refuse to load the client applications more than once in the 
     10463    * Properly refuse to load the client applications more than once in the
    1046010464      same JVM.
    1046110465    * Added support for a graceful restart (a graceful shutdown followed by a
     
    1046810472      Specifically, a file "router.ping" in the install directory which is
    1046910473      written to once a minute - if that file exists and has been modified
    10470       within the last minute, refuse to start up.  In turn, adjust the 
     10474      within the last minute, refuse to start up.  In turn, adjust the
    1047110475      service wrapper to wait a minute before restarting a crashed JVM.
    1047210476    * Create a "work" directory in the I2P install dir which Jetty will
     
    1047510479
    10476104802004-09-04  jrandom
    10477     * Update the SDK to automatically reconnect indefinitely with an 
     10481    * Update the SDK to automatically reconnect indefinitely with an
    1047810482      exponential delay on retries (capped at 5 minutes).
    1047910483
     
    10495104992004-09-03  oOo
    1049610500    * Added some filters to the HTTP request, replacing the User-Agent,
    10497       Referrer, Via, and From headers, which helps until we have a more 
     10501      Referrer, Via, and From headers, which helps until we have a more
    1049810502      comprehensive filtering system.
    1049910503
     
    1050210506
    10503105072004-09-02  jrandom
    10504     * Cleaned up the base build.xml, adding a new target ("updater") which 
    10505       builds the file i2pupdate.tar.bz2 which can be safely extracted over 
     10508    * Cleaned up the base build.xml, adding a new target ("updater") which
     10509      builds the file i2pupdate.tar.bz2 which can be safely extracted over
    1050610510      existing installs.
    1050710511
     
    10516105202004-xx-xx  hypercubus
    1051710521    * Implemented the new installation process.
    10518     * Integrated systray 
     10522    * Integrated systray
    1051910523    * Integrated service manager
    1052010524
    10521105252004-xx-xx  oOo
    10522     * Implemented ?i2paddresshelper= hook 
     10526    * Implemented ?i2paddresshelper= hook
    1052310527    * Many small bugfixes to the web interface, router, i2ptunnel, and core.
    1052410528
  • router/java/src/net/i2p/router/RouterVersion.java

    r11ff89f r97f2328  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 22;
     21    public final static long BUILD = 23;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.