Changeset 01e8743


Ignore:
Timestamp:
Nov 16, 2009 7:45:10 PM (10 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
d268a38
Parents:
060f4e6 (diff), 3df5540 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '18a7dd067a56c2552cf30f4a045628f91c360c80'

and 'd6b8e99c4aee82652446fe759f45f27e0da9fbc0'

Files:
17 added
29 edited
14 moved

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.io.File;
  • apps/addressbook/java/src/net/i2p/addressbook/ConfigParser.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.io.BufferedReader;
  • apps/addressbook/java/src/net/i2p/addressbook/Daemon.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.io.File;
  • apps/addressbook/java/src/net/i2p/addressbook/DaemonThread.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424/**
  • apps/addressbook/java/src/net/i2p/addressbook/Log.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.io.BufferedWriter;
  • apps/addressbook/java/src/net/i2p/addressbook/Servlet.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import javax.servlet.GenericServlet;
  • apps/addressbook/java/src/net/i2p/addressbook/Subscription.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424/**
  • apps/addressbook/java/src/net/i2p/addressbook/SubscriptionIterator.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.util.Iterator;
  • apps/addressbook/java/src/net/i2p/addressbook/SubscriptionList.java

    r060f4e6 r01e8743  
    2020 */
    2121
    22 package addressbook;
     22package net.i2p.addressbook;
    2323
    2424import java.io.File;
  • apps/addressbook/web.xml

    r060f4e6 r01e8743  
    77        <servlet>
    88                <servlet-name>addressbook</servlet-name>
    9                 <servlet-class>addressbook.Servlet</servlet-class>
     9                <servlet-class>net.i2p.addressbook.Servlet</servlet-class>
    1010                <init-param>
    1111                    <param-name>home</param-name>
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    r060f4e6 r01e8743  
    715715       ,"WELTERDE", "http://tracker.welterde.i2p/a=http://tracker.welterde.i2p/stats?mode=top5"
    716716       , "CRSTRACK", "http://b4G9sCdtfvccMAXh~SaZrPqVQNyGQbhbYMbw6supq2XGzbjU4NcOmjFI0vxQ8w1L05twmkOvg5QERcX6Mi8NQrWnR0stLExu2LucUXg1aYjnggxIR8TIOGygZVIMV3STKH4UQXD--wz0BUrqaLxPhrm2Eh9Hwc8TdB6Na4ShQUq5Xm8D4elzNUVdpM~RtChEyJWuQvoGAHY3ppX-EJJLkiSr1t77neS4Lc-KofMVmgI9a2tSSpNAagBiNI6Ak9L1T0F9uxeDfEG9bBSQPNMOSUbAoEcNxtt7xOW~cNOAyMyGydwPMnrQ5kIYPY8Pd3XudEko970vE0D6gO19yoBMJpKx6Dh50DGgybLQ9CpRaynh2zPULTHxm8rneOGRcQo8D3mE7FQ92m54~SvfjXjD2TwAVGI~ae~n9HDxt8uxOecAAvjjJ3TD4XM63Q9TmB38RmGNzNLDBQMEmJFpqQU8YeuhnS54IVdUoVQFqui5SfDeLXlSkh4vYoMU66pvBfWbAAAA.i2p/tracker/announce.php=http://crstrack.i2p/tracker/"
    717        , "ThePirateBay", "http://tracker.thepiratebay.i2p/announce=http://thepiratebay.i2p/"
    718717    };
    719718   
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    r060f4e6 r01e8743  
    506506        String announce = snark.meta.getAnnounce();
    507507        if (announce.startsWith("http://YRgrgTLG") || announce.startsWith("http://8EoJZIKr") ||
    508             announce.startsWith("http://4svjpPox") || announce.startsWith("http://tracker.thepiratebay.i2p/") ||
    509508            announce.startsWith("http://lnQ6yoBT") || announce.startsWith("http://tracker2.postman.i2p/")) {
    510509            Map trackers = _manager.getTrackers();
     
    514513                String baseURL = (String)entry.getValue();
    515514                if (!(baseURL.startsWith(announce) || // vvv hack for non-b64 announce in list vvv
    516                       (announce.startsWith("http://lnQ6yoBT") && baseURL.startsWith("http://tracker2.postman.i2p/")) ||
    517                       (announce.startsWith("http://4svjpPox") && baseURL.startsWith("http://thepiratebay.i2p/"))))
     515                      (announce.startsWith("http://lnQ6yoBT") && baseURL.startsWith("http://tracker2.postman.i2p/"))))
    518516                    continue;
    519517                int e = baseURL.indexOf('=');
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java

    r060f4e6 r01e8743  
    44package net.i2p.i2ptunnel;
    55
     6import java.io.ByteArrayOutputStream;
    67import java.io.BufferedReader;
    78import java.io.File;
     9import java.io.FileInputStream;
    810import java.io.IOException;
    911import java.io.InputStream;
     
    1618import java.util.HashMap;
    1719import java.util.List;
     20import java.util.Locale;
    1821import java.util.Properties;
    1922import java.util.StringTokenizer;
     
    5659    private HashMap addressHelpers = new HashMap();
    5760
     61    /**
     62     *  These are backups if the xxx.ht error page is missing.
     63     */
     64
    5865    private final static byte[] ERR_REQUEST_DENIED =
    5966        ("HTTP/1.1 403 Access Denied\r\n"+
     
    7885        .getBytes();
    7986   
     87/*****
    8088    private final static byte[] ERR_TIMEOUT =
    8189        ("HTTP/1.1 504 Gateway Timeout\r\n"+
     
    8997         "the following Destination:<BR><BR>")
    9098        .getBytes();
     99*****/
    91100
    92101    private final static byte[] ERR_NO_OUTPROXY =
     
    109118         "than a host entry in your host database. "+
    110119         "Someone could be trying to impersonate another eepsite, "+
    111          "or people have given two eepsites identical names.<P/>"+
     120         "or people have given two eepsites identical names.<p>"+
    112121         "You can resolve the conflict by considering which key you trust, "+
    113122         "and either discarding the addresshelper link, "+
    114123         "discarding the host entry from your host database, "+
    115          "or naming one of them differently.<P/>")
     124         "or naming one of them differently.<p>")
    116125         .getBytes();
    117126   
     
    377386                            if (ahelperConflict)
    378387                            {
    379                                 String str;
    380                                 byte[] header;
    381                                 str = FileUtil.readTextFile((new File(_errorDir, "ahelper-conflict-header.ht")).getAbsolutePath(), 100, true);
    382                                 if (str != null) header = str.getBytes();
    383                                   else header = ERR_AHELPER_CONFLICT;
    384388
    385389                                if (out != null) {
     390                                    // Fixme untranslated
    386391                                    long alias = I2PAppContext.getGlobalContext().random().nextLong();
    387392                                    String trustedURL = protocol + uriPath + urlEncoding;
    388393                                    String conflictURL = protocol + alias + ".i2p/?" + initialFragments;
     394                                    byte[] header = getErrorPage("ahelper-conflict", ERR_AHELPER_CONFLICT);
    389395                                    out.write(header);
    390                                     out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<P/>").getBytes());
    391                                     out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
    392                                     out.write(new Date().toString().getBytes());
    393                                     out.write("</i></div></body></html>\n".getBytes());
    394                                     out.flush();
     396                                    out.write(("To visit the destination in your host database, click <a href=\"" + trustedURL + "\">here</a>. To visit the conflicting addresshelper link by temporarily giving it a random alias, click <a href=\"" + conflictURL + "\">here</a>.<p></div>").getBytes());
     397                                    writeFooter(out);
    395398                                }
    396399                                s.close();
     
    409412                    } else if (host.toLowerCase().equals("localhost") || host.equals("127.0.0.1")) {
    410413                        if (out != null) {
    411                             out.write(ERR_LOCALHOST);
    412                             out.write("<p /><i>Generated on: ".getBytes());
    413                             out.write(new Date().toString().getBytes());
    414                             out.write("</i></body></html>\n".getBytes());
    415                             out.flush();
     414                            out.write(getErrorPage("localhost", ERR_LOCALHOST));
     415                            writeFooter(out);
    416416                        }
    417417                        s.close();
     
    431431                            l.log("No HTTP outproxy found for the request.");
    432432                            if (out != null) {
    433                                 out.write(ERR_NO_OUTPROXY);
    434                                 out.write("<p /><i>Generated on: ".getBytes());
    435                                 out.write(new Date().toString().getBytes());
    436                                 out.write("</i></body></html>\n".getBytes());
    437                                 out.flush();
     433                                out.write(getErrorPage("noproxy", ERR_NO_OUTPROXY));
     434                                writeFooter(out);
    438435                            }
    439436                            s.close();
     
    450447                            l.log("Invalid request url [" + request + "]");
    451448                            if (out != null) {
    452                                 out.write(ERR_REQUEST_DENIED);
    453                                 out.write("<p /><i>Generated on: ".getBytes());
    454                                 out.write(new Date().toString().getBytes());
    455                                 out.write("</i></body></html>\n".getBytes());
    456                                 out.flush();
     449                                out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
     450                                writeFooter(out);
    457451                            }
    458452                            s.close();
     
    541535                if (out != null) {
    542536                    if ("http://".equalsIgnoreCase(protocol))
    543                         out.write(ERR_REQUEST_DENIED);
     537                        out.write(getErrorPage("denied", ERR_REQUEST_DENIED));
    544538                    else
    545                         out.write(ERR_BAD_PROTOCOL);
    546                     out.write("<p /><i>Generated on: ".getBytes());
    547                     out.write(new Date().toString().getBytes());
    548                     out.write("</i></body></html>\n".getBytes());
    549                     out.flush();
     539                        out.write(getErrorPage("protocol", ERR_BAD_PROTOCOL));
     540                    writeFooter(out);
    550541                }
    551542                s.close();
     
    569560                if (_log.shouldLog(Log.WARN))
    570561                    _log.warn("Unable to resolve " + destination + " (proxy? " + usingWWWProxy + ", request: " + targetRequest);
    571                 String str;
    572562                byte[] header;
    573563                boolean showAddrHelper = false;
    574564                if (usingWWWProxy)
    575                     str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true);
     565                    header = getErrorPage("dnfp", ERR_DESTINATION_UNKNOWN);
    576566                else if(ahelper != 0)
    577                     str = FileUtil.readTextFile((new File(_errorDir, "dnfb-header.ht")).getAbsolutePath(), 100, true);
     567                    header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN);
    578568                else if (destination.length() == 60 && destination.endsWith(".b32.i2p"))
    579                     str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true);
     569                    header = getErrorPage("dnf", ERR_DESTINATION_UNKNOWN);
    580570                else {
    581                     str = FileUtil.readTextFile((new File(_errorDir, "dnfh-header.ht")).getAbsolutePath(), 100, true);
     571                    header = getErrorPage("dnfh", ERR_DESTINATION_UNKNOWN);
    582572                    showAddrHelper = true;
    583573                }
    584                 if (str != null)
    585                     header = str.getBytes();
    586                 else
    587                     header = ERR_DESTINATION_UNKNOWN;
    588574                writeErrorMessage(header, out, targetRequest, usingWWWProxy, destination, showAddrHelper);
    589575                s.close();
     
    659645    }
    660646
     647    /**
     648     *  foo => errordir/foo-header_xx.ht for lang xx, or errordir/foo-header.ht,
     649     *  or the backup byte array on fail.
     650     *
     651     *  .ht files must be UTF-8 encoded and use \r\n terminators so the
     652     *  HTTP headers are conformant.
     653     *  We can't use FileUtil.readFile() because it strips \r
     654     *
     655     *  @return non-null
     656     */
     657    private byte[] getErrorPage(String base, byte[] backup) {
     658        return getErrorPage(getTunnel().getContext(), base, backup);
     659    }
     660
     661    private static byte[] getErrorPage(I2PAppContext ctx, String base, byte[] backup) {
     662         File errorDir = new File(ctx.getBaseDir(), "docs");
     663         String lang = ctx.getProperty("routerconsole.lang", Locale.getDefault().getLanguage());
     664         if (lang != null && lang.length() > 0 && !lang.equals("en")) {
     665             File file = new File(errorDir, base + "-header_" + lang + ".ht");
     666             try {
     667                 return readFile(file);
     668             } catch (IOException ioe) {
     669                 // try the english version now
     670             }
     671         }
     672         File file = new File(errorDir, base + "-header.ht");
     673         try {
     674             return readFile(file);
     675         } catch (IOException ioe) {
     676             return backup;
     677         }
     678    }
     679
     680    private static byte[] readFile(File file) throws IOException {
     681         FileInputStream fis = null;
     682         byte[] buf = new byte[512];
     683         ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
     684         try {
     685             int len = 0;
     686             fis = new FileInputStream(file);
     687             while ((len = fis.read(buf)) > 0) {
     688                 baos.write(buf, 0, len);
     689             }
     690             return baos.toByteArray();
     691         } finally {
     692             try { if (fis != null) fis.close(); } catch (IOException foo) {}
     693         }
     694         // we won't ever get here
     695    }
     696
     697    private static void writeFooter(OutputStream out) throws IOException {
     698        // the css is hiding this div for now, but we'll keep it here anyway
     699        out.write("<div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br>Generated on: ".getBytes());
     700        out.write(new Date().toString().getBytes());
     701        out.write("</i></div></body></html>\n".getBytes());
     702        out.flush();
     703    }
     704
    661705    private static class OnTimeout implements Runnable {
    662706        private Socket _socket;
     
    706750                out.write(uri.getBytes());
    707751                out.write("</a>".getBytes());
    708                 if (usingWWWProxy) out.write(("<br />WWW proxy: " + wwwProxy).getBytes());
     752                if (usingWWWProxy) out.write(("<br>WWW proxy: " + wwwProxy).getBytes());
    709753                if (showAddrHelper) {
    710                     out.write("<br /><br />Click a link below to look for an address helper by using a \"jump\" service:<br />".getBytes());
     754                    // Fixme untranslated
     755                    out.write("<br><br>Click a link below to look for an address helper by using a \"jump\" service:<br>".getBytes());
    711756                    for (int i = 0; i < jumpServers.length; i++) {
    712757                        // Skip jump servers we don't know
     
    720765                        }
    721766
    722                         out.write("<br /><a href=\"".getBytes());
     767                        out.write("<br><a href=\"".getBytes());
    723768                        out.write(jumpServers[i].getBytes());
    724769                        out.write(uri.getBytes());
     
    730775                }
    731776            }
    732             out.write("</div><div class=\"proxyfooter\"><p><i>I2P HTTP Proxy Server<br />Generated on: ".getBytes());
    733             out.write(new Date().toString().getBytes());
    734             out.write("</i></div></body></html>\n".getBytes());
    735             out.flush();
     777            out.write("</div>".getBytes());
     778            writeFooter(out);
    736779        }
    737780    }
     
    745788        if (out != null) {
    746789            try {
    747                 String str;
    748790                byte[] header;
    749791                if (usingWWWProxy)
    750                     str = FileUtil.readTextFile((new File(_errorDir, "dnfp-header.ht")).getAbsolutePath(), 100, true);
     792                    header = getErrorPage(I2PAppContext.getGlobalContext(), "dnfp", ERR_DESTINATION_UNKNOWN);
    751793                else
    752                     str = FileUtil.readTextFile((new File(_errorDir, "dnf-header.ht")).getAbsolutePath(), 100, true);
    753                 if (str != null)
    754                     header = str.getBytes();
    755                 else
    756                     header = ERR_DESTINATION_UNKNOWN;
     794                    header = getErrorPage(I2PAppContext.getGlobalContext(), "dnf", ERR_DESTINATION_UNKNOWN);
    757795                writeErrorMessage(header, out, targetRequest, usingWWWProxy, wwwProxy, false);
    758796            } catch (IOException ioe) {
  • apps/routerconsole/java/bmsg.sh

    r060f4e6 r01e8743  
    1515## walking - public domain :-D
    1616
    17 
    18 CLASS=net.i2p.router.web.messages
    19 TMPFILE=build/javafiles.txt
    20 export TZ=UTC
    21 
    22 #
    23 # generate strings/Countries.java from ../../../installer/resources/countries.txt
    24 #
    25 CFILE=../../../installer/resources/countries.txt
    26 JFILE=build/Countries.java
    27 if [ $CFILE -nt $JFILE -o ! -s $JFILE ]
    28 then
    29         mkdir -p build
    30         echo '// Automatically generated pseudo-java for xgettext - do not edit' > $JFILE
    31         echo '// Translators may wish to translate a few of these, do not bother to translate all of them!!' >> $JFILE
    32         sed 's/..,\(..*\)/_("\1");/' $CFILE >> $JFILE
    33 fi
    34 
    35 # list specific files in router/ here, so we don't scan the whole tree
    36 ROUTERFILES="\
    37    ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \
    38    ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java"
    39 JPATHS="src ../jsp/WEB-INF strings $JFILE $ROUTERFILES"
    40 for i in ../locale/messages_*.po
    41 do
    42         # get language
    43         LG=${i#../locale/messages_}
    44         LG=${LG%.po}
    45 
    46         # make list of java files newer than the .po file
    47         find $JPATHS -name *.java -newer $i > $TMPFILE
    48         if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a \
    49              build/obj/net/i2p/router/web/messages_$LG.class -nt $i -a \
    50              ! -s $TMPFILE ]
    51         then
    52                 continue
    53         fi
    54 
    55         echo "Generating ${CLASS}_$LG ResourceBundle..."
    56 
    57         # extract strings from java and jsp files, and update messages.po files
    58         # translate calls must be one of the forms:
    59         # _("foo")
    60         # _x("foo")
    61         # intl._("foo")
    62         # intl.title("foo")
    63         # handler._("foo")
    64         # formhandler._("foo")
    65         # net.i2p.router.web.Messages.getString("foo")
    66         # In a jsp, you must use a helper or handler that has the context set.
    67         # To start a new translation, copy the header from an old translation to the new .po file,
    68         # then ant distclean updater.
    69         find $JPATHS -name *.java > $TMPFILE
    70         xgettext -f $TMPFILE -F -L java --from-code=UTF-8 \
    71                  --keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \
    72                  --keyword=handler._ --keyword=formhandler._ \
    73                  --keyword=net.i2p.router.web.Messages.getString \
    74                  -o ${i}t
    75         if [ $? -ne 0 ]
    76         then
    77                 echo 'Warning - xgettext failed, not updating translations'
    78                 rm -f ${i}t
    79                 break
    80         fi
    81         msgmerge -U --backup=none $i ${i}t
    82         if [ $? -ne 0 ]
    83         then
    84                 echo 'Warning - msgmerge failed, not updating translations'
    85                 rm -f ${i}t
    86                 break
    87         fi
    88         rm -f ${i}t
    89         # so we don't do this again
    90         touch $i
    91 
    92         # convert to class files in build/obj
    93         msgfmt --java -r $CLASS -l $LG -d build/obj $i
    94         if [ $? -ne 0 ]
    95         then
    96                 echo 'Warning - msgfmt failed, not updating translations'
    97                 break
    98         fi
    99 done
    100 rm -f $TMPFILE
    101 # todo: return failure
    102 exit 0
     17source bundle-messages.sh
  • apps/routerconsole/java/bundle-messages.sh

    r060f4e6 r01e8743  
    2525ROUTERFILES="\
    2626   ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java \
    27    ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java"
     27   ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java \
     28   ../../../router/java/src/net/i2p/router/transport/TransportManager.java \
     29   ../../../router/java/src/net/i2p/router/transport/GetBidsJob.java \
     30   ../../../router/java/src/net/i2p/router/Blocklist.java \
     31   ../../../router/java/src/net/i2p/router/transport/ntcp/EstablishState.java"
     32
    2833JPATHS="src ../jsp/WEB-INF strings $JFILE $ROUTERFILES"
    2934for i in ../locale/messages_*.po
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigPeerHandler.java

    r060f4e6 r01e8743  
    2121            Hash h = getHash();
    2222            if (h != null) {
    23                 _context.shitlist().shitlistRouterForever(h, "Manually banned via <a href=\"configpeer.jsp\">configpeer.jsp</a>");
     23                _context.shitlist().shitlistRouterForever(h, _("Manually banned via {0}"), "<a href=\"configpeer.jsp\">configpeer.jsp</a>");
    2424                addFormNotice(_("Peer") + " " + _peer + " " + _("banned until restart") );
    2525                return;
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java

    r060f4e6 r01e8743  
    4444            buf.append("<input type=\"hidden\" name=\"pool.").append(cur).append("\" value=\"");
    4545            buf.append(dest.calculateHash().toBase64()).append("\" >");   
    46             renderForm(buf, cur, prefix, _("Client tunnels for") + " " + name, in, out);
     46            renderForm(buf, cur, prefix, _("Client tunnels for") + " " + _(name), in, out);
    4747            cur++;
    4848        }
  • apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java

    r060f4e6 r01e8743  
    202202        // transports table
    203203        buf.append("<table>\n");
    204         buf.append("<tr><th align=\"left\">" + _("Addresses") + "</th><th>" + _("Count") + "</th></tr>\n");
     204        buf.append("<tr><th align=\"left\">" + _("Transports") + "</th><th>" + _("Count") + "</th></tr>\n");
    205205        for (int i = 0; i < 8; i++) {
    206206            int num = transportCount[i];
     
    277277        for (Iterator iter = info.getAddresses().iterator(); iter.hasNext(); ) {
    278278            RouterAddress addr = (RouterAddress)iter.next();
    279             buf.append("<b>").append(DataHelper.stripHTML(addr.getTransportStyle())).append("</b>: ");
     279            buf.append("<b>").append(DataHelper.stripHTML(addr.getTransportStyle())).append(":</b> ");
    280280            for (Iterator optIter = addr.getOptions().keySet().iterator(); optIter.hasNext(); ) {
    281281                String name = (String)optIter.next();
  • apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java

    r060f4e6 r01e8743  
    235235        buf.append("</table>");
    236236
    237         buf.append("<h3>").append(_("Thresholds:")).append("</h3>");
     237        buf.append("<h3>").append(_("Thresholds")).append("</h3>");
    238238        buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold()))
    239239           .append(" (").append(fast).append(' ').append(_("fast peers")).append(")<br>");
     
    242242        buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
    243243           .append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")</p>");
    244         buf.append("<h3>").append(_("Definitions")).append(":</h3><ul>");
     244        buf.append("<h3>").append(_("Definitions")).append("</h3><ul>");
    245245        buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
    246246        buf.append("<li><b>").append(_("caps")).append("</b>: ").append(_("capabilities in the netDb, not used to determine profiles")).append("</li>");
  • apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java

    r060f4e6 r01e8743  
    2121    public String getShitlistSummary() {
    2222        try {
    23             _context.shitlist().renderStatusHTML(_out);
     23            ShitlistRenderer rend = new ShitlistRenderer(_context);
     24            rend.renderStatusHTML(_out);
    2425        } catch (IOException ioe) {
    2526            ioe.printStackTrace();
  • apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java

    r060f4e6 r01e8743  
    3838   
    3939    public void renderStatusHTML(Writer out) throws IOException {
    40         out.write("<div class=\"wideload\"><h2><a name=\"exploratory\" ></a>" + _("Exploratory tunnels") + " (<a href=\"/configtunnels.jsp#exploratory\">" + _("config") + "</a>):</h2>\n");
     40        out.write("<div class=\"wideload\"><h2><a name=\"exploratory\" ></a>" + _("Exploratory tunnels") + " (<a href=\"/configtunnels.jsp#exploratory\">" + _("configure") + "</a>)</h2>\n");
    4141        renderPool(out, _context.tunnelManager().getInboundExploratoryPool(), _context.tunnelManager().getOutboundExploratoryPool());
    4242       
     
    6060                      + "\" ></a>" + _("Client tunnels for") + ' ' + _(name));
    6161            if (_context.clientManager().isLocal(client))
    62                 out.write(" (<a href=\"/configtunnels.jsp#" + client.toBase64().substring(0,4) +"\">" + _("config") + "</a>):</h2>\n");
    63             else
    64                 out.write(" (dead):</h2>\n");
     62                out.write(" (<a href=\"/configtunnels.jsp#" + client.toBase64().substring(0,4) +"\">" + _("configure") + "</a>)</h2>\n");
     63            else
     64                out.write(" (" + _("dead") + ")</h2>\n");
    6565            renderPool(out, in, outPool);
    6666        }
     
    6868        List participating = _context.tunnelDispatcher().listParticipatingTunnels();
    6969        Collections.sort(participating, new TunnelComparator());
    70         out.write("<h2><a name=\"participating\"></a>" + _("Participating tunnels") + ":</h2><table>\n");
     70        out.write("<h2><a name=\"participating\"></a>" + _("Participating tunnels") + "</h2><table>\n");
    7171        out.write("<tr><th>" + _("Receive on") + "</th><th>" + _("From") + "</th><th>"
    7272                  + _("Send on") + "</th><th>" + _("To") + "</th><th>" + _("Expiration") + "</th>"
     
    105105                out.write(" <td class=\"cells\" align=\"center\">" + DataHelper.formatDuration(timeLeft) + "</td>");
    106106            else
    107                 out.write(" <td class=\"cells\" align=\"center\">(grace period)</td>");
     107                out.write(" <td class=\"cells\" align=\"center\">(" + _("grace period") + ")</td>");
    108108            out.write(" <td class=\"cells\" align=\"center\">" + cfg.getProcessedMessagesCount() + "KB</td>");
    109109            int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000);
     
    232232        Collections.sort(peerList, new HashComparator());
    233233
    234         out.write("<h2><a name=\"peers\"></a>" + _("Tunnel Counts By Peer") + ":</h2>\n");
     234        out.write("<h2><a name=\"peers\"></a>" + _("Tunnel Counts By Peer") + "</h2>\n");
    235235        out.write("<table><tr><th>" + _("Peer") + "</th><th>" + _("Expl. + Client") + "</th><th>" + _("% of total") + "</th><th>" + _("Part. from + to") + "</th><th>" + _("% of total") + "</th></tr>\n");
    236236        for (Hash h : peerList) {
  • apps/routerconsole/jsp/help.jsp

    r060f4e6 r01e8743  
    2020<li class="tidylist"><a href="http://www.i2p2.i2p/faq.html">FAQ on www.i2p2.i2p</a>
    2121<li class="tidylist"><a href="http://www.i2p2.i2p/faq_de.html">Deutsch FAQ</a>.</ul>
    22 </p><p>You may also try the <a href="http://forum.i2p/">I2P forum</a>
     22<br>You may also try the <a href="http://forum.i2p/">I2P forum</a>
    2323or IRC.</p>
    2424
  • apps/routerconsole/locale/messages_zh.po

    r060f4e6 r01e8743  
    99"Project-Id-Version: I2P routerconsole\n"
    1010"Report-Msgid-Bugs-To: \n"
    11 "POT-Creation-Date: 2009-11-11 11:09+0000\n"
     11"POT-Creation-Date: 2009-11-12 06:00+0000\n"
    1212"PO-Revision-Date: \n"
    1313"Last-Translator: walking <walking@mail.i2p>\n"
     
    1919"X-Poedit-Country: CHINA\n"
    2020
     21#: ../../../router/java/src/net/i2p/router/Blocklist.java:117
     22#, java-format
     23msgid "Banned by router hash: {0}"
     24msgstr "按路由器指纹封杀:{0}"
     25
     26#: ../../../router/java/src/net/i2p/router/Blocklist.java:119
     27msgid "Banned by router hash"
     28msgstr "路由指纹封锁"
     29
     30#: ../../../router/java/src/net/i2p/router/Blocklist.java:664
     31msgid "IP banned"
     32msgstr "IP封锁"
     33
     34#: ../../../router/java/src/net/i2p/router/Blocklist.java:734
     35#, java-format
     36msgid "IP banned by blocklist.txt entry {0}"
     37msgstr "按IP黑名单blocklist.txt封杀的节点{0}"
     38
    2139#: ../../../router/java/src/net/i2p/router/RouterThrottleImpl.java:91
    2240msgid "Rejecting tunnels: Shutting down"
     
    5472msgid "Rejecting tunnels"
    5573msgstr "拒绝参与共享隧道"
     74
     75#: ../../../router/java/src/net/i2p/router/transport/GetBidsJob.java:70
     76msgid "No transports (hidden or starting up?)"
     77msgstr "无数据传输(隐身或正在启动)"
     78
     79#: ../../../router/java/src/net/i2p/router/transport/TransportManager.java:450
     80msgid "Unreachable on any transport"
     81msgstr "各协议均不可达"
     82
     83#: ../../../router/java/src/net/i2p/router/transport/ntcp/EstablishState.java:373
     84#: ../../../router/java/src/net/i2p/router/transport/ntcp/EstablishState.java:578
     85#, java-format
     86msgid "Excessive clock skew: {0}"
     87msgstr "严重时滞:{0}"
    5688
    5789#: ../../../router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java:128
     
    837869#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configlogging_jsp.java:329
    838870msgid "Log level overrides"
    839 msgstr "等级外日志项目"
     871msgstr "等级外<br>日志项目"
    840872
    841873#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configpeer_jsp.java:106
     
    857889#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configpeer_jsp.java:310
    858890msgid "Manually Ban / Unban a Peer"
    859 msgstr "手动封/解封某个节点"
     891msgstr "手动封/解封某个节点"
    860892
    861893#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configpeer_jsp.java:312
     
    866898#: src/net/i2p/router/web/ConfigPeerHandler.java:20
    867899msgid "Ban peer until restart"
    868 msgstr "封节点直到重启"
     900msgstr "封节点直到重启"
    869901
    870902#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configpeer_jsp.java:316
     
    12201252#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:326
    12211253msgid "Update through the eepProxy?"
    1222 msgstr "通过eepProxy更新?"
     1254msgstr "通过I2P代理更新?"
    12231255
    12241256#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:330
    12251257msgid "eepProxy host"
    1226 msgstr "eepProxy主机"
     1258msgstr "I2P代理主机"
    12271259
    12281260#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:334
    12291261msgid "eepProxy port"
    1230 msgstr "eepProxy端口"
     1262msgstr "I2P代理端口"
    12311263
    12321264#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/configupdate_jsp.java:338
     
    13351367#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/stats_jsp.java:105
    13361368msgid "statistics"
    1337 msgstr "统计数据"
     1369msgstr "统计"
    13381370
    13391371#: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/stats_jsp.java:242
     
    24542486#: src/net/i2p/router/web/SummaryBarRenderer.java:124
    24552487msgid "Stats"
    2456 msgstr "统计数据"
     2488msgstr "统计"
    24572489
    24582490#: src/net/i2p/router/web/ConfigNavHelper.java:20
     
    25432575msgid "bits per second"
    25442576msgstr "比特/秒"
     2577
     2578#: src/net/i2p/router/web/ConfigPeerHandler.java:23
     2579#, java-format
     2580msgid "Manually banned via {0}"
     2581msgstr "通过{0}手动封锁"
    25452582
    25462583#: src/net/i2p/router/web/ConfigPeerHandler.java:24
     
    32503287
    32513288#: src/net/i2p/router/web/ProfileOrganizerRenderer.java:237
    3252 msgid "Thresholds:"
    3253 msgstr "临界值:"
     3289msgid "Thresholds"
     3290msgstr "临界值"
    32543291
    32553292#: src/net/i2p/router/web/ProfileOrganizerRenderer.java:239
     
    33213358msgstr ""
    33223359
     3360#: src/net/i2p/router/web/ShitlistRenderer.java:57
     3361#, java-format
     3362msgid "Temporary ban expiring in {0}"
     3363msgstr "临时封锁{0}后解除"
     3364
     3365#: src/net/i2p/router/web/ShitlistRenderer.java:59
     3366#, java-format
     3367msgid "Banned until restart or in {0}"
     3368msgstr "封锁直到重启或{0}后"
     3369
     3370#: src/net/i2p/router/web/ShitlistRenderer.java:71
     3371msgid "unban now"
     3372msgstr "立即解封"
     3373
    33233374#: src/net/i2p/router/web/StatsGenerator.java:58
    33243375msgid "Statistics gathered during this router's uptime"
     
    33673418#: src/net/i2p/router/web/SummaryBarRenderer.java:68
    33683419msgid "Webserver"
    3369 msgstr "匿名网站服务器"
     3420msgstr "匿名主页服务器"
    33703421
    33713422#: src/net/i2p/router/web/SummaryBarRenderer.java:72
     
    36393690#: src/net/i2p/router/web/TunnelRenderer.java:40
    36403691#: src/net/i2p/router/web/TunnelRenderer.java:62
    3641 msgid "config"
     3692msgid "configure"
    36423693msgstr "设置"
     3694
     3695#: src/net/i2p/router/web/TunnelRenderer.java:64
     3696msgid "dead"
     3697msgstr "失效"
    36433698
    36443699#: src/net/i2p/router/web/TunnelRenderer.java:70
     
    36793734msgstr "使用情况"
    36803735
     3736#: src/net/i2p/router/web/TunnelRenderer.java:107
     3737msgid "grace period"
     3738msgstr "过渡期"
     3739
    36813740#: src/net/i2p/router/web/TunnelRenderer.java:117
    36823741msgid "Outbound Endpoint"
     
    37963855#: strings/Strings.java:25
    37973856msgid "My eepsite web server"
    3798 msgstr "我的匿名Web服务器"
     3857msgstr "匿名主页服务器"
    37993858
    38003859#: strings/Strings.java:26
     
    38083867#: strings/Strings.java:34
    38093868msgid "IRC proxy"
    3810 msgstr "IRC 代理"
     3869msgstr "I2P聊天室"
    38113870
    38123871#: strings/Strings.java:35
     
    38203879#: strings/Strings.java:38
    38213880msgid "ircProxy"
    3822 msgstr "IRC代理"
     3881msgstr "I2P聊天室"
    38233882
    38243883#: strings/Strings.java:40
  • build.xml

    r060f4e6 r01e8743  
    287287        <mkdir dir="pkg-temp/scripts" />
    288288        <copy file="apps/proxyscript/i2pProxy.pac" todir="pkg-temp/scripts/" />
     289        <!-- test classes aren't in the jars anymore
    289290        <copy file="core/perl/i2pbench.sh" todir="pkg-temp/scripts/" />
    290291        <copy file="core/perl/i2ptest.sh" todir="pkg-temp/scripts/" />
     292        -->
    291293        <!-- polecat: please put your modified toolbar.html in installer/resources/toolbar.html
    292294             and uncomment the following -->
     
    334336        <!-- Since the logo moved, we have to update the error pages -->
    335337        <copy todir="pkg-temp/docs/" >
    336           <fileset dir="installer/resources/" includes="*-header.ht" />
     338          <fileset dir="installer/resources/proxy" />
    337339        </copy>
    338340        <!-- make a "classic" theme -->
     
    373375        <copy todir="pkg-temp/docs/" >
    374376          <fileset dir="." includes="readme*.html" />
    375           <fileset dir="installer/resources/" includes="*-header.ht" />
     377          <fileset dir="installer/resources/proxy" />
    376378        </copy>
    377379    </target>
  • core/java/src/net/i2p/util/FileUtil.java

    r060f4e6 r01e8743  
    197197     * the file doesn't exist. 
    198198     *
     199     * Warning - this inefficiently allocates a StringBuilder of size maxNumLines*80,
     200     *           so don't make it too big.
     201     * Warning - converts \r\n to \n
     202     *
    199203     * @param startAtBeginning if true, read the first maxNumLines, otherwise read
    200204     *                         the last maxNumLines
    201205     * @param maxNumLines max number of lines (or -1 for unlimited)
     206     * @return string or null; does not throw IOException.
    202207     *
    203208     */
  • history.txt

    r060f4e6 r01e8743  
     12009-11-16 zzz
     2    * addressbook: Move class to net.i2p.addressbook
     3    * build: Take two test scripts out of the installer
     4    * i2psnark: Bye TPB
     5    * Shitlist: Fix bug from two checkins ago, all were forever
     6
     72009-11-14 zzz
     8    * HTTP Proxy:
     9      - Add support for error page translations
     10      - Add support for external pages for all errors
     11      - Fix lack of \r in error page headers
     12      - HTML transitional fixes
     13      - Cleanups
     14    * UDP PeerTestManager: Throw in some synchronization to
     15      try to fix stuck tests
     16
     172009-11-11 zzz
     18    * Console: Some colon cleansing
     19    * FloodfillPeerSelector: Adjustments
     20    * Shitlist: Move HTML renderer to router console,
     21      add cause parameter for ease of translation,
     22      tag all causes
     23
    1242009-11-11 zzz
    225    * Addressbook, NamingService: Allow 516 byte dests
  • hosts.txt

    r060f4e6 r01e8743  
    320320docs.i2p2.i2p=BhSHFwXW7zGTLRVTRuTfgxWC1PxKGDyY2OYpS0IrDnYhQklWVFxHz4xVpw8UXo8LTFXAnAjknrcYdLt6DfHcO-ZkFPo5UbOIfywSsHoet4J6BQ1MOt1MLTAejks4Rkj3~sfK2fJHHvHYTjm1v5~f8c13ZH5fPfQ3A71RRCyiYaeO5-VxC6rqvW~z0dNO~-jakjwD7tHtzQL2vQTqarYT859yUiHmLJ~yw5jXfxNBhlxIxaXg0Nat9S5N2W4Eqemy-UYtSGOM4IUGKoM902JxhVpz~O1~iB5H211E3x-o8dKTt9Yz2G5Qcp1kRB0NCO2Noivsxjnfv~64zoUVbPepyJFQKenRtX844HgOESNcUp~FoVzI~QJne5irJDMLK1dNsua3L1kz0MA-2Aev8byWe4TIXeZCuDpYi4bRK6OPKDETwJG8edw7CFtsQaFI-2wGMFu8GDH7pUL8~1qyDjjFv5c~q1MFhty9q8LRUGHHgWP47u9n8OX4zcS4P1~5z2M3AAAA
    321321paste.i2p2.i2p=PbHXL5PXan7siJiFcUAV~VC0JCLxgnoOnZFjyvJ0dbYlQ3fi1K6SD961pjQ51OSeTnbe5iGRzbY2X0~pG4k~hexau4NizxprAdgdiC-4J3-xpVRjZ4IxuMoDXp-V8Nhv8pLCQcxiEXbWft2v7zLvkp2y6uqH7kab8FXL~z568rMMH0DDs8imwAawasyGtLLo77X8n-C0K~7orcWDVZicWABJ-zky1Zlllx~Y~S8RHWyN4dueP6wkH484b81xNbbt3P-HzE3TcKAvUcSV1Bq4J5UNafQYU7DhV7roUtw4HuJYoxiXnlXVeC-uTCGF~bPrjrB-~Yn0KyObmXs5yvAcKHIS2tgmlsP9nahyn1ZOrlZc0L3DEsv4rkfQyzHVBxcCzMUOchWehE09GLy3bviWZ43lB7kU8kRaja7G4xLrD-CXNXq6q7WNYXrqX7EmtsvCo8VDcFn2ODyLb3eyDe~CkO7ES7mv3u8jJxJRQEcjj71pvu7bMzSMh-xN08X6vx9AAAAA
    322 thepiratebay.i2p=9Sng0F-cAyGgPyr1xenqY87Uf2AG~PlTXzUJRQnr7gpYFPUfRlH3OfWOVFat67jUl37ZzWBOSYC7-6YqFzPQV5u~DrTGaoImfa7BsRbnBlPXbSNIaP59C6Vp1RCbhtTpxQ4PvLLn9xzUKWoPkrQ222TCSxPR6-j2ChSuuCIA7bP7EP75BobL6n9hMmekzB4FbmBhC64Kri72Uhv~rMDdMZaDD9cD9-BgnZkyrI5jRtSuOUVnTexKMQ0UiYHanSDlBvNwLRMGdb0AsckOdXHrleKrwPnW4YTp0q89dPGP6fad4sVxgvxLHF6NuoWXGbnD0sYuv5qkegjBzioHOjxI~n52ObdeELVhs~peeiXpRavZcwlu1HzwNKfU8lJrpnLSoQsCuqd4OBFMmjvo3HhovLsTeUAo1W2O1F8gcPeOj3tD0ihInncMIbEUTI7kdbkBTsoMY8~73jKgQYC0c~hiEUb1tG4NLcfdxgAlWF5q9cJPDHFh9jtzDvq63OntBQ5OAAAA
    323 tracker.thepiratebay.i2p=4svjpPox0vc527neBdWyfLiVulEeHtzQrC6IDDB2~rPwnZYWm3xsyrDYTa9gu5~1QrFitr5RMCcj34tzZZCKIg~INFNhi7Zk7UwsOCHtedS0RpRjDi2O3q~T~k8D4P39Rz0So91D624lofDV48itdkX8B3dNUHE0Qq5hCGjb2UVxLUhKh8DYOUAqYPoLaF1RpQx5DT~r-Hf57vA9bW3Q31xYH~Ys6AxCZ8~EmMqdgm0ZMQ57oWldHgkSbtQsoiBn2igJ24GDUDUvBsRVLt7He1nKg1ei2JvqQajKN31cQeS5fjqiGdUTkXjc1FftKB8HC9CbnsMJjPEFT6gvvtSpxULvSQGSJyD6OIzebXvQIYANAapEk1VP1OSIJlteOIwGDXkGj9ZyLpT7~RpUpk92v9L53Zjof~WjJmGqqWWsL~yypl0~nMUw5MLaKv5AJywDnFIJDR-GlkQQj5fECeefge30Y92CHwxgImwj3v7~DwXuU9d5u6KyzJSuByOGRvwVAAAA
  • installer/resources/clients.config

    r060f4e6 r01e8743  
    99clientApp.0.args=7657 ::1,127.0.0.1 ./webapps/
    1010clientApp.0.main=net.i2p.router.web.RouterConsoleRunner
    11 clientApp.0.name=Web console
     11clientApp.0.name=I2P Router Console
    1212clientApp.0.onBoot=true
    1313clientApp.0.startOnLoad=true
     
    1515# SAM bridge
    1616clientApp.1.main=net.i2p.sam.SAMBridge
    17 clientApp.1.name=SAM application bridge
     17clientApp.1.name=SAM Application Bridge
    1818clientApp.1.args=sam.keys 127.0.0.1 7656 i2cp.tcp.host=127.0.0.1 i2cp.tcp.port=7654
    1919clientApp.1.startOnLoad=false
     
    2121# poke the i2ptunnels defined in i2ptunnel.config
    2222clientApp.2.main=net.i2p.i2ptunnel.TunnelControllerGroup
    23 clientApp.2.name=Application tunnels
     23clientApp.2.name=Application Tunnels
    2424clientApp.2.args=i2ptunnel.config
    2525clientApp.2.startOnLoad=true
     
    2727# run our own eepsite with a seperate jetty instance
    2828clientApp.3.main=org.mortbay.jetty.Server
    29 clientApp.3.name=My eepsite web server
     29clientApp.3.name=Local Anonymous I2P Webserver
    3030clientApp.3.args="eepsite/jetty.xml"
    3131clientApp.3.delay=30
     
    3434# load a browser pointing at the web console whenever we start up
    3535clientApp.4.main=net.i2p.apps.systray.UrlLauncher
    36 clientApp.4.name=Browser launch at startup
     36clientApp.4.name=Launch web browser and load I2P Router Console at startup
    3737clientApp.4.args=http://127.0.0.1:7657/index.jsp
    3838clientApp.4.delay=15
  • installer/resources/proxy/ahelper-conflict-header.ht

    r060f4e6 r01e8743  
    11HTTP/1.1 409 Conflict
    2 Content-Type: text/html; charset=iso-8859-1
     2Content-Type: text/html; charset=UTF-8
    33Cache-control: no-cache
    44Connection: close
     
    77<html><head>
    88<title>I2P Warning: Destination key conflict</title>
    9 <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" />
    10 <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" />
     9<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
     10<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
    1111</head>
    1212<body>
    1313<div class=logo>
    14  <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr>
     14 <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
    1515 <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
    1616</div>
     
    2121Someone could be trying to impersonate another eepsite,
    2222or people have given two eepsites identical names.
    23 <P/>
     23<p>
    2424You can resolve the conflict by considering which key you trust,
    2525and either discarding the addresshelper link,
    2626discarding the host entry from your host database,
    2727or naming one of them differently.
    28 <P/>
     28<p>
  • installer/resources/proxy/dnf-header.ht

    r060f4e6 r01e8743  
    11HTTP/1.1 504 Gateway Timeout
    2 Content-Type: text/html; charset=iso-8859-1
     2Content-Type: text/html; charset=UTF-8
    33Cache-control: no-cache
    44Connection: close
     
    77<html><head>
    88<title>I2P Warning: Eepsite not reachable</title>
    9 <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" />
    10 <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" />
     9<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
     10<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
    1111</head>
    1212<body>
    1313<div class=logo>
    14  <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr>
     14 <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
    1515 <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a>
    1616</div>
  • installer/resources/proxy/dnfb-header.ht

    r060f4e6 r01e8743  
    11HTTP/1.1 400 Destination Not Found
    2 Content-Type: text/html; charset=iso-8859-1
     2Content-Type: text/html; charset=UTF-8
    33Cache-control: no-cache
    44Connection: close
     
    77<html><head>
    88<title>I2P Warning: Invalid eepsite destination</title>
    9 <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" />
    10 <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" />
     9<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
     10<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
    1111</head>
    1212<body>
    1313<div class=logo>
    14  <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr>
     14 <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
    1515 <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
    1616</div>
  • installer/resources/proxy/dnfh-header.ht

    r060f4e6 r01e8743  
    11HTTP/1.1 404 Domain Not Found
    2 Content-Type: text/html; charset=iso-8859-1
     2Content-Type: text/html; charset=UTF-8
    33Cache-control: no-cache
    44Connection: close
     
    77<html><head>
    88<title>I2P Warning: Eepsite unknown</title>
    9 <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" />
    10 <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" />
     9<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
     10<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
    1111</head>
    1212<body>
    1313<div class=logo>
    14  <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr>
     14 <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
    1515 <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/index.jsp">Addressbook</a>
    1616</div>
  • installer/resources/proxy/dnfp-header.ht

    r060f4e6 r01e8743  
    11HTTP/1.1 504 Gateway Timeout
    2 Content-Type: text/html; charset=iso-8859-1
     2Content-Type: text/html; charset=UTF-8
    33Cache-control: no-cache
    44Connection: close
     
    77<html><head>
    88<title>I2P Warning: Outproxy Not Found</title>
    9 <link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" />
    10 <link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" />
     9<link rel="shortcut icon" href="http://proxy.i2p/themes/console/images/favicon.ico" >
     10<link href="http://proxy.i2p/themes/console/default/console.css" rel="stylesheet" type="text/css" >
    1111</head>
    1212<body>
    1313<div class=logo>
    14  <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"/></a><hr>
     14 <a href="http://127.0.0.1:7657/index.jsp" title="Router Console"><img src="http://proxy.i2p/themes/console/images/i2plogo.png" alt="I2P Router Console" border="0"></a><hr>
    1515 <a href="http://127.0.0.1:7657/config.jsp">Configuration</a> <a href="http://127.0.0.1:7657/help.jsp">Help</a> <a href="http://127.0.0.1:7657/susidns/">Addressbook</a>
    1616</div>
  • installer/resources/themes/console/midnight/console.css

    r060f4e6 r01e8743  
    11/* I2P Theme: Midnight */
    2 /* I2P Description: Minimalist Midnight Blue, based on Classic theme.*/
     2/* Description: Minimalist Midnight Blue, based on Classic theme.*/
    33/* Author: Dr|Z3d */
    44
     
    108108
    109109div.warning h3 {
     110     border: 0;
    110111     border-bottom: 1px solid #fb7;
    111112     padding-bottom: 10px;
     113     padding-left: 0;
     114     font-variant: small-caps;
     115     text-transform: capitalize;
     116     font-size: 12.5pt;
    112117}
    113118
     
    115120
    116121div.sorry {
    117      padding: 20px;
     122     padding: 20px 20px 20px 70px;
    118123     background: #003;
    119      margin: -2px 1px 0 200px;
    120      border: 1px solid #99f;
     124     margin: 0 5px 0 200px;
     125     border: 1px solid #99f;
     126     border-top: 0;
    121127     text-align: justify;
    122128     -moz-box-shadow: inset 0px 0px 0px 1px #d00;
     
    124130     font-weight: bold;
    125131     color: #eef;
     132     background-image: url("../images/errortriangle.png");
     133     background-position: 15px center;
     134     background-repeat: no-repeat;
    126135}
    127136
    128137div.sorry hr {
    129      color: #eef;
    130      background: #eef;
     138     color: #99f;
     139     background: #99f;
    131140     height: 1px;
    132      border: 1px solid #99f;
     141     border: 0;
    133142     margin: 10px 0;
    134143}
     
    154163     color: inherit;
    155164     margin: 0;
    156      padding: 10px 1px 7px 1px;
     165     padding: 10px 1px 5px 1px;
    157166     text-align: center !important;
    158167     border: 1px solid #99f;
     
    173182     border-bottom: 0px solid #99f;
    174183     margin: 8px -1px 7px -1px;
     184}
     185
     186div.routersummary hr:last-child {
     187     display: none;
    175188}
    176189
     
    252265}
    253266
     267div.routersummary form:last-child {
     268     padding-top: 3px !important;
     269     margin-bottom: -10px !important;     
     270}
     271
    254272div.refresh {
    255273     margin-top: 10px !important;
     
    289307     color: #eef;
    290308     min-width: 570px;
    291      -moz-box-shadow: inset 0px 0px 2px 0px #005;
    292309}
    293310
     
    322339     margin-top: 20px;
    323340     margin-bottom: -5px;
     341     padding-bottom: 10px !important;
     342}
     343
     344table h2 {
     345     padding-bottom: 15px;
    324346}
    325347
     
    496518     text-align: center;
    497519     border: 1px solid #99f;
    498      padding: 13px 10px 12px 10px;
     520     padding: 15px 10px 15px 10px;
    499521     margin: 5px 5px 0 200px;
    500522     line-height: 93%;
     
    503525     background: #000008;
    504526     min-width: 600px;
    505      -moz-box-shadow: inset 0px 0px 4px 2px #00000A;
    506527     line-height: 100%;
    507528     color: #fff;
     
    509530
    510531h2 {
    511      font-size: 14pt;
     532     font-size: 13pt;
    512533     padding: 10px 10px 10px 10px;
    513534     border: 1px solid #77f;
    514535     border-top: 1px solid #99f;
    515536     border-left: 1px solid #99f;
    516      letter-spacing: 0.04em;
    517      background: #00000A;
     537     background: #000008;
     538     background-image: url("images/h2bg.png");
     539     background-repeat: no-repeat;
     540     background-position: right center;
     541     font-variant: small-caps;
     542     text-transform: capitalize;
     543     letter-spacing: 0.07em;
    518544}
    519545
    520546h3 {
    521      font-size: 12pt;
    522      padding: 0 0px 5px 0px;
    523      border-bottom: 1px solid #99f;
    524      border-top: 0px solid #99f;
     547     font-size: 11pt;
     548     padding: 5px 10px;
     549     border: 1px solid #99f;
     550     border-right: 1px solid #77f;
     551     border-bottom: 1px solid #77f;
    525552     letter-spacing: 0.04em;
    526553     margin-bottom: 10px;
     
    601628     color: #eef;
    602629     text-align: center;
    603      margin: -7px 0 7px 0;
     630     margin: -5px 0 5px 0;
    604631     background: #000;
    605632     border: 1px solid #99f;
    606633     border-top: 0;
    607      padding: 4px 0 2px 0;
     634     padding: 3px 0;
    608635}
    609636
     
    723750     text-align: justify;
    724751     margin-top: 5px !important;
    725      margin-left:5px !important;     
     752     margin-left: 5px !important;     
    726753}
    727754
     
    787814
    788815div.graphspanel {
    789      padding: 5px 0px 20px 0px;
     816     padding: 10px 0px 20px 0px;
    790817     margin: -16px -16px -11px -16px;
    791818     background: #000012;
     
    794821     border-radius: 4px;
    795822     border: 1px solid #99f;
    796      -moz-box-shadow: inset 0px 0px 1px 0px #002;
    797823     text-align: center !important;   
    798824}
    799825
    800826div.graphspanel img {
    801      border: 1px solid #77f;
     827     border: 1px solid #99f;
    802828     padding: 2px;
    803829     margin: 6px;
    804      background: #ccf;
    805      -moz-box-shadow: inset 0px 0px 0px 0px #002;
     830     background: #00000A;
    806831     opacity: 0.9;
    807832}
    808833
    809834div.graphspanel img:hover {
    810      border: 1px solid #003;
     835     border: 1px solid #f60;
    811836     padding: 2px;
    812837     margin: 6px;
    813838     text-align: center !important;
    814      background: #eef;
    815      -moz-box-shadow: inset 0px 0px 2px 1px #f60;
     839     background: #002;
    816840     opacity: 1;
    817841}
  • router/java/src/net/i2p/router/Blocklist.java

    r060f4e6 r01e8743  
    112112            for (Iterator iter = _peerBlocklist.keySet().iterator(); iter.hasNext(); ) {
    113113                Hash peer = (Hash) iter.next();
    114                 String reason = "Banned by router hash";
     114                String reason;
    115115                String comment = (String) _peerBlocklist.get(peer);
    116116                if (comment != null)
    117                     reason = reason + ": " + comment;
    118                 _context.shitlist().shitlistRouterForever(peer, reason);
     117                    reason = _x("Banned by router hash: {0}");
     118                else
     119                    reason = _x("Banned by router hash");
     120                _context.shitlist().shitlistRouterForever(peer, reason, comment);
    119121            }
    120122            _peerBlocklist = null;
     
    660662    public void shitlist(Hash peer) {
    661663        // Temporary reason, until the job finishes
    662         _context.shitlist().shitlistRouterForever(peer, "IP Banned");
     664        _context.shitlist().shitlistRouterForever(peer, _x("IP banned"));
    663665        if (! "true".equals( _context.getProperty(PROP_BLOCKLIST_DETAIL, "true")))
    664666            return;
     
    730732                    if (match(ipint, toEntry(e.ip1, e.ip2))) {
    731733                        try { in.close(); } catch (IOException ioe) {}
    732                         String reason = "IP ";
    733                         for (int i = 0; i < 4; i++) {
    734                             reason = reason + (ip[i] & 0xff);
    735                             if (i != 3)
    736                                 reason = reason + '.';
    737                         }
    738                         reason = reason + " banned by " + BLOCKLIST_FILE_DEFAULT + " entry \"" + buf + "\"";
     734                        String reason = _x("IP banned by blocklist.txt entry {0}");
     735                        // only one translate parameter for now
     736                        //for (int i = 0; i < 4; i++) {
     737                        //    reason = reason + (ip[i] & 0xff);
     738                        //    if (i != 3)
     739                        //        reason = reason + '.';
     740                        //}
     741                        //reason = reason + " banned by " + BLOCKLIST_FILE_DEFAULT + " entry \"" + buf + "\"";
    739742                        if (_log.shouldLog(Log.WARN))
    740743                            _log.warn("Shitlisting " + peer + " " + reason);
    741                         _context.shitlist().shitlistRouterForever(peer, reason);
     744                        _context.shitlist().shitlistRouterForever(peer, reason, buf.toString());
    742745                        return;
    743746                    }
     
    792795    }
    793796
     797    /**
     798     *  Mark a string for extraction by xgettext and translation.
     799     *  Use this only in static initializers.
     800     *  It does not translate!
     801     *  @return s
     802     */
     803    private static final String _x(String s) {
     804        return s;
     805    }
     806
    794807    public static void main(String args[]) {
    795808        Blocklist b = new Blocklist();
  • router/java/src/net/i2p/router/RouterVersion.java

    r060f4e6 r01e8743  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 15;
     21    public final static long BUILD = 18;
    2222    /** for example "-test" */
    2323    public final static String EXTRA = "";
  • router/java/src/net/i2p/router/Shitlist.java

    r060f4e6 r01e8743  
    1313import java.util.concurrent.ConcurrentHashMap;
    1414import java.util.ArrayList;
    15 import java.util.Comparator;
     15import java.util.HashMap;
    1616import java.util.Iterator;
    1717import java.util.List;
    1818import java.util.Map;
    1919import java.util.Set;
    20 import java.util.TreeMap;
    2120
    2221import net.i2p.data.DataHelper;
     
    3736    private Map<Hash, Entry> _entries;
    3837   
    39     private static class Entry {
     38    public static class Entry {
    4039        /** when it should expire, per the i2p clock */
    41         long expireOn;
     40        public long expireOn;
    4241        /** why they were shitlisted */
    43         String cause;
     42        public String cause;
     43        /** separate code so cause can contain {0} for translation */
     44        public String causeCode;
    4445        /** what transports they were shitlisted for (String), or null for all transports */
    45         Set<String> transports;
     46        public Set<String> transports;
    4647    }
    4748   
     
    9697    }
    9798   
     99    /** for ShitlistRenderer in router console */
     100    public Map<Hash, Entry> getEntries() {
     101        return new HashMap<Hash, Entry>(_entries);
     102    }
     103   
    98104    public boolean shitlistRouter(Hash peer) {
    99105        return shitlistRouter(peer, null);
    100106    }
    101107    public boolean shitlistRouter(Hash peer, String reason) { return shitlistRouter(peer, reason, null); }
     108    /** ick have to put the reasonCode in the front to avoid ambiguity */
     109    public boolean shitlistRouter(String reasonCode, Hash peer, String reason) {
     110        return shitlistRouter(peer, reason, reasonCode, null, false);
     111    }
    102112    public boolean shitlistRouter(Hash peer, String reason, String transport) {
    103113        return shitlistRouter(peer, reason, transport, false);
     
    106116        return shitlistRouter(peer, reason, null, true);
    107117    }
     118    public boolean shitlistRouterForever(Hash peer, String reason, String reasonCode) {
     119        return shitlistRouter(peer, reason, reasonCode, null, true);
     120    }
    108121    public boolean shitlistRouter(Hash peer, String reason, String transport, boolean forever) {
     122        return shitlistRouter(peer, reason, null, transport, forever);
     123    }
     124    private boolean shitlistRouter(Hash peer, String reason, String reasonCode, String transport, boolean forever) {
    109125        if (peer == null) {
    110126            _log.error("wtf, why did we try to shitlist null?", new Exception("shitfaced"));
     
    138154        }
    139155        e.cause = reason;
     156        e.causeCode = reasonCode;
    140157        e.transports = null;
    141158        if (transport != null) {
     
    151168                    e.expireOn = old.expireOn;
    152169                    e.cause = old.cause;
     170                    e.causeCode = old.causeCode;
    153171                }
    154172                if (e.transports != null) {
     
    158176                        e.transports = null;
    159177                        e.cause = reason;
     178                        e.causeCode = reasonCode;
    160179                    }
    161180                }
     
    246265    }
    247266
    248     class HashComparator implements Comparator {
    249          public int compare(Object l, Object r) {
    250              return ((Hash)l).toBase64().compareTo(((Hash)r).toBase64());
    251         }
    252     }
    253 
     267    /** @deprecated moved to router console */
    254268    public void renderStatusHTML(Writer out) throws IOException {
    255         StringBuilder buf = new StringBuilder(1024);
    256         // move to the jsp
    257         //buf.append("<h2>Banned Peers</h2>");
    258         Map<Hash, Entry> entries = new TreeMap(new HashComparator());
    259        
    260         entries.putAll(_entries);
    261 
    262         buf.append("<ul>");
    263        
    264         for (Map.Entry<Hash, Entry> e : entries.entrySet()) {
    265             Hash key = e.getKey();
    266             Entry entry = e.getValue();
    267             buf.append("<li>").append(_context.commSystem().renderPeerHTML(key));
    268             long expires = entry.expireOn-_context.clock().now();
    269             if (expires < 5l*24*60*60*1000)
    270                 buf.append(" Temporary ban expiring in ");
    271             else
    272                 buf.append(" Banned until restart or in ");
    273             buf.append(DataHelper.formatDuration(expires));
    274             Set transports = entry.transports;
    275             if ( (transports != null) && (transports.size() > 0) )
    276                 buf.append(" on the following transport: ").append(transports);
    277             if (entry.cause != null) {
    278                 buf.append("<br>\n");
    279                 buf.append(entry.cause);
    280             }
    281             buf.append(" (<a href=\"configpeer.jsp?peer=").append(key.toBase64()).append("#unsh\">unban now</a>)");
    282             buf.append("</li>\n");
    283         }
    284         buf.append("</ul>\n");
    285         out.write(buf.toString());
    286         out.flush();
    287269    }
    288270}
  • router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java

    r060f4e6 r01e8743  
    8686   
    8787    /**
     88     *  Sort the floodfills. The challenge here is to keep the good ones
     89     *  at the front and the bad ones at the back. If they are all good or bad,
     90     *  searches and stores won't work well.
     91     *
    8892     *  @return all floodfills not shitlisted foreverx
    8993     *  @param key the routing key
     
    9195     *  Sorted by closest to the key if > maxNumRouters, otherwise not
    9296     *  The list is in 3 groups - sorted by routing key within each group.
    93      *  Group 1: No store or lookup failure in last 15 minutes
    94      *  Group 2: No store or lookup failure in last 3 minutes
     97     *  Group 1: No store or lookup failure in a long time
     98     *  Group 2: No store or lookup failure in a little while or
     99     *           success newer than failure
    95100     *  Group 3: All others
    96101     */
     
    99104    }
    100105
    101     /** 1.5 * PublishLocalRouterInfoJob.PUBLISH_DELAY */
    102     private static final int NO_FAIL_STORE_OK = 30*60*1000;
     106    /** .75 * PublishLocalRouterInfoJob.PUBLISH_DELAY */
     107    private static final int NO_FAIL_STORE_OK = 15*60*1000;
    103108    private static final int NO_FAIL_STORE_GOOD = NO_FAIL_STORE_OK * 2;
     109    /** this must be longer than the max streaming timeout (60s) */
    104110    private static final int NO_FAIL_LOOKUP_OK = 5*60*1000;
    105111    private static final int NO_FAIL_LOOKUP_GOOD = NO_FAIL_LOOKUP_OK * 3;
     112    private static final int MAX_GOOD_RESP_TIME = 5*1000;
    106113
    107114    public List<Hash> selectFloodfillParticipants(Hash key, int howMany, Set<Hash> toIgnore, KBucketSet kbuckets) {
     
    111118
    112119        List<Hash> rv = new ArrayList(howMany);
    113         List<Hash> okff = new ArrayList(howMany);
    114         List<Hash> badff = new ArrayList(howMany);
     120        List<Hash> okff = new ArrayList(ffs.size());
     121        List<Hash> badff = new ArrayList(ffs.size());
    115122        int found = 0;
    116123        long now = _context.clock().now();
     
    126133                badff.add(entry);
    127134                if (_log.shouldLog(Log.DEBUG))
    128                     _log.debug("Skipping, published a while ago: " + entry);
     135                    _log.debug("Old: " + entry);
    129136            } else {
    130137                PeerProfile prof = _context.profileOrganizer().getProfile(entry);
    131138                if (prof != null && prof.getDBHistory() != null
     139                    && ((int) prof.getDbResponseTime().getRate(10*60*1000).getAverageValue()) < MAX_GOOD_RESP_TIME
    132140                    && prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_GOOD
    133141                    && prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_GOOD) {
     
    138146                    found++;
    139147                } else if (prof != null && prof.getDBHistory() != null
    140                            && prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_OK
    141                            && prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_OK) {
     148                           && (prof.getDBHistory().getLastStoreFailed() <= prof.getDBHistory().getLastStoreSuccessful()
     149                               || prof.getDBHistory().getLastLookupFailed() <= prof.getDBHistory().getLastLookupSuccessful()
     150                               || (prof.getDBHistory().getLastStoreFailed() < now - NO_FAIL_STORE_OK
     151                                   && prof.getDBHistory().getLastLookupFailed() < now - NO_FAIL_LOOKUP_OK))) {
    142152                    if (_log.shouldLog(Log.DEBUG))
    143153                        _log.debug("OK: " + entry);
     
    150160            }
    151161        }
    152         if (_log.shouldLog(Log.DEBUG))
    153             _log.debug("Good: " + rv + " OK: " + okff + " Bad: " + badff);
     162        if (_log.shouldLog(Log.INFO))
     163            _log.info("Good: " + rv + " OK: " + okff + " Bad: " + badff);
    154164
    155165        // Put the ok floodfills after the good floodfills
  • router/java/src/net/i2p/router/transport/GetBidsJob.java

    r060f4e6 r01e8743  
    6868                context.statManager().addRateData("transport.bidFailNoTransports", msg.getLifetime(), 0);
    6969                // This used to be "no common transports" but it is almost always no transports at all
    70                 context.shitlist().shitlistRouter(to, "No transports (hidden or starting up?)");
     70                context.shitlist().shitlistRouter(to, _x("No transports (hidden or starting up?)"));
    7171            } else if (failedCount >= facade.getTransportCount()) {
    7272                context.statManager().addRateData("transport.bidFailAllTransports", msg.getLifetime(), 0);
     
    9999        msg.discardData();
    100100    }
     101
     102    /**
     103     *  Mark a string for extraction by xgettext and translation.
     104     *  Use this only in static initializers.
     105     *  It does not translate!
     106     *  @return s
     107     */
     108    private static final String _x(String s) {
     109        return s;
     110    }
    101111}
  • router/java/src/net/i2p/router/transport/TransportManager.java

    r060f4e6 r01e8743  
    448448            if (unreachableTransports >= _transports.size() && countActivePeers() > 0) {
    449449                _context.statManager().addRateData("transport.shitlistOnUnreachable", msg.getLifetime(), msg.getLifetime());
    450                 _context.shitlist().shitlistRouter(peer, "Unreachable on any transport");
     450                _context.shitlist().shitlistRouter(peer, _x("Unreachable on any transport"));
    451451            }
    452452        } else if (rv == null) {
     
    494494        }
    495495        StringBuilder buf = new StringBuilder(4*1024);
    496         buf.append("<h3>Router Transport Addresses:</h3><pre>\n");
     496        buf.append("<h3>Router Transport Addresses</h3><pre>\n");
    497497        for (int i = 0; i < _transports.size(); i++) {
    498498            Transport t = (Transport)_transports.get(i);
     
    509509        out.flush();
    510510    }
     511
     512    /**
     513     *  Mark a string for extraction by xgettext and translation.
     514     *  Use this only in static initializers.
     515     *  It does not translate!
     516     *  @return s
     517     */
     518    private static final String _x(String s) {
     519        return s;
     520    }
     521
    511522}
  • router/java/src/net/i2p/router/transport/ntcp/EstablishState.java

    r060f4e6 r01e8743  
    369369                    _context.statManager().addRateData("ntcp.invalidOutboundSkew", diff, 0);
    370370                    _transport.markReachable(_con.getRemotePeer().calculateHash(), false);
    371                     _context.shitlist().shitlistRouter(_con.getRemotePeer().calculateHash(),
    372                                                        "Excessive clock skew: " + DataHelper.formatDuration(diff));
     371                    _context.shitlist().shitlistRouter(DataHelper.formatDuration(diff),
     372                                                       _con.getRemotePeer().calculateHash(),
     373                                                       _x("Excessive clock skew: {0}"));
    373374                    fail("Clocks too skewed (" + diff + " ms)", null, true);
    374375                    return;
     
    573574                    _context.statManager().addRateData("ntcp.invalidInboundSkew", diff, 0);
    574575                    _transport.markReachable(alice.calculateHash(), true);
    575                     _context.shitlist().shitlistRouter(alice.calculateHash(), "Clock skew of " + diff + " ms");
     576                    _context.shitlist().shitlistRouter(DataHelper.formatDuration(diff),
     577                                                       alice.calculateHash(),
     578                                                       _x("Excessive clock skew: {0}"));
    576579                    fail("Clocks too skewed (" + diff + " ms)", null, true);
    577580                    return;
     
    924927        }
    925928    }
     929
     930    /**
     931     *  Mark a string for extraction by xgettext and translation.
     932     *  Use this only in static initializers.
     933     *  It does not translate!
     934     *  @return s
     935     */
     936    private static final String _x(String s) {
     937        return s;
     938    }
     939
    926940}
  • router/java/src/net/i2p/router/transport/udp/PeerTestManager.java

    r060f4e6 r01e8743  
    2020
    2121/**
    22  *
     22 *  From udp.html on the website:
     23
     24<p>The automation of collaborative reachability testing for peers is
     25enabled by a sequence of PeerTest messages.  With its proper
     26execution, a peer will be able to determine their own reachability
     27and may update its behavior accordingly.  The testing process is
     28quite simple:</p>
     29
     30<pre>
     31        Alice                  Bob                  Charlie
     32    PeerTest -------------------&gt;
     33                             PeerTest--------------------&gt;
     34                                &lt;-------------------PeerTest
     35         &lt;-------------------PeerTest
     36         &lt;------------------------------------------PeerTest
     37    PeerTest------------------------------------------&gt;
     38         &lt;------------------------------------------PeerTest
     39</pre>
     40
     41<p>Each of the PeerTest messages carry a nonce identifying the
     42test series itself, as initialized by Alice.  If Alice doesn't
     43get a particular message that she expects, she will retransmit
     44accordingly, and based upon the data received or the messages
     45missing, she will know her reachability.  The various end states
     46that may be reached are as follows:</p>
     47
     48<ul>
     49<li>If she doesn't receive a response from Bob, she will retransmit
     50up to a certain number of times, but if no response ever arrives,
     51she will know that her firewall or NAT is somehow misconfigured,
     52rejecting all inbound UDP packets even in direct response to an
     53outbound packet.  Alternately, Bob may be down or unable to get
     54Charlie to reply.</li>
     55
     56<li>If Alice doesn't receive a PeerTest message with the
     57expected nonce from a third party (Charlie), she will retransmit
     58her initial request to Bob up to a certain number of times, even
     59if she has received Bob's reply already.  If Charlie's first message
     60still doesn't get through but Bob's does, she knows that she is
     61behind a NAT or firewall that is rejecting unsolicited connection
     62attempts and that port forwarding is not operating properly (the
     63IP and port that Bob offered up should be forwarded).</li>
     64
     65<li>If Alice receives Bob's PeerTest message and both of Charlie's
     66PeerTest messages but the enclosed IP and port numbers in Bob's
     67and Charlie's second messages don't match, she knows that she is
     68behind a symmetric NAT, rewriting all of her outbound packets with
     69different 'from' ports for each peer contacted.  She will need to
     70explicitly forward a port and always have that port exposed for
     71remote connectivity, ignoring further port discovery.</li>
     72
     73<li>If Alice receives Charlie's first message but not his second,
     74she will retransmit her PeerTest message to Charlie up to a
     75certain number of times, but if no response is received she knows
     76that Charlie is either confused or no longer online.</li>
     77</ul>
     78
     79<p>Alice should choose Bob arbitrarily from known peers who seem
     80to be capable of participating in peer tests.  Bob in turn should
     81choose Charlie arbitrarily from peers that he knows who seem to be
     82capable of participating in peer tests and who are on a different
     83IP from both Bob and Alice.  If the first error condition occurs
     84(Alice doesn't get PeerTest messages from Bob), Alice may decide
     85to designate a new peer as Bob and try again with a different nonce.</p>
     86
     87<p>Alice's introduction key is included in all of the PeerTest
     88messages so that she doesn't need to already have an established
     89session with Bob and so that Charlie can contact her without knowing
     90any additional information.  Alice may go on to establish a session
     91with either Bob or Charlie, but it is not required.</p>
     92
    2393 */
    2494class PeerTestManager {
     
    2797    private UDPTransport _transport;
    2898    private PacketBuilder _packetBuilder;
    29     /** map of Long(nonce) to PeerTestState for tests currently in progress */
    30     private final Map _activeTests;
    31     /** current test we are running, or null */
     99    /** map of Long(nonce) to PeerTestState for tests currently in progress (as Bob/Charlie) */
     100    private final Map<Long, PeerTestState> _activeTests;
     101    /** current test we are running (as Alice), or null */
    32102    private PeerTestState _currentTest;
    33103    private boolean _currentTestComplete;
    34     private List _recentTests;
     104    /** as Alice */
     105    private List<Long> _recentTests;
    35106   
    36107    /** longest we will keep track of a Charlie nonce for */
    37108    private static final int MAX_CHARLIE_LIFETIME = 10*1000;
    38109
     110    /**
     111     *  Have seen peer tests (as Alice) get stuck (_currentTest != null)
     112     *  so I've thrown some synchronizization on the methods;
     113     *  don't know the root cause or whether this fixes it
     114     */
    39115    public PeerTestManager(RouterContext context, UDPTransport transport) {
    40116        _context = context;
     
    55131    private static final long MAX_NONCE = (1l << 32) - 1l;
    56132    //public void runTest(InetAddress bobIP, int bobPort, SessionKey bobIntroKey) {
    57     public void runTest(InetAddress bobIP, int bobPort, SessionKey bobCipherKey, SessionKey bobMACKey) {
     133
     134    /**
     135     *  The next few methods are for when we are Alice
     136     */
     137    public synchronized void runTest(InetAddress bobIP, int bobPort, SessionKey bobCipherKey, SessionKey bobMACKey) {
    58138        if (_currentTest != null) {
    59139            if (_log.shouldLog(Log.WARN))
     
    86166    private class ContinueTest implements SimpleTimer.TimedEvent {
    87167        public void timeReached() {
    88             PeerTestState state = _currentTest;
    89             if (state == null) {
    90                 // already completed
    91                 return;
    92             } else if (expired()) {
    93                 testComplete(true);
    94             } else if (_context.clock().now() - state.getLastSendTime() >= RESEND_TIMEOUT) {
    95                 if (state.getReceiveBobTime() <= 0) {
    96                     // no message from Bob yet, send it again
    97                     sendTestToBob();
    98                 } else if (state.getReceiveCharlieTime() <= 0) {
    99                     // received from Bob, but no reply from Charlie.  send it to
    100                     // Bob again so he pokes Charlie
    101                     sendTestToBob();
    102                 } else {
    103                     // received from both Bob and Charlie, but we haven't received a
    104                     // second message from Charlie yet
    105                     sendTestToCharlie();
    106                 }
    107                 SimpleScheduler.getInstance().addEvent(ContinueTest.this, RESEND_TIMEOUT);
    108             }
    109         }
    110     }
    111 
     168            synchronized (PeerTestManager.this) {
     169                PeerTestState state = _currentTest;
     170                if (state == null) {
     171                    // already completed
     172                    return;
     173                } else if (expired()) {
     174                    testComplete(true);
     175                } else if (_context.clock().now() - state.getLastSendTime() >= RESEND_TIMEOUT) {
     176                    if (state.getReceiveBobTime() <= 0) {
     177                        // no message from Bob yet, send it again
     178                        sendTestToBob();
     179                    } else if (state.getReceiveCharlieTime() <= 0) {
     180                        // received from Bob, but no reply from Charlie.  send it to
     181                        // Bob again so he pokes Charlie
     182                        sendTestToBob();
     183                    } else {
     184                        // received from both Bob and Charlie, but we haven't received a
     185                        // second message from Charlie yet
     186                        sendTestToCharlie();
     187                    }
     188                    SimpleScheduler.getInstance().addEvent(ContinueTest.this, RESEND_TIMEOUT);
     189                }
     190            }
     191        }
     192    }
     193
     194    /** call from a synchronized method */
    112195    private boolean expired() {
    113196        PeerTestState state = _currentTest;
     
    118201    }
    119202   
     203    /** call from a synchronized method */
    120204    private void sendTestToBob() {
    121205        PeerTestState test = _currentTest;
     
    129213        }
    130214    }
     215    /** call from a synchronized method */
    131216    private void sendTestToCharlie() {
    132217        PeerTestState test = _currentTest;
     
    154239    /**
    155240     * Receive a PeerTest message which contains the correct nonce for our current
    156      * test
    157      */
    158     private void receiveTestReply(RemoteHostId from, UDPPacketReader.PeerTestReader testInfo) {
     241     * test. We are Alice.
     242     */
     243    private synchronized void receiveTestReply(RemoteHostId from, UDPPacketReader.PeerTestReader testInfo) {
    159244        _context.statManager().addRateData("udp.receiveTestReply", 1, 0);
    160245        PeerTestState test = _currentTest;
     
    209294                    _log.warn("Bob chose a charlie we already have a session to, cancelling the test and rerunning (bob: "
    210295                              + _currentTest + ", charlie: " + from + ")");
     296                // why are we doing this instead of calling testComplete() ?
    211297                _currentTestComplete = true;
    212298                _context.statManager().addRateData("udp.statusKnownCharlie", 1, 0);
     
    268354     * we have successfully received the second PeerTest from a Charlie.
    269355     *
     356     * @param forgetTest must be true to clear out this test and allow another
     357     *
     358     * call from a synchronized method
    270359     */
    271360    private void testComplete(boolean forgetTest) {
     
    325414     * that should be sent in response, or if its a reply to our own current testing,
    326415     * adjusting our test state.
    327      *
     416     * We could be Alice, Bob, or Charlie.
    328417     */
    329418    public void receiveTest(RemoteHostId from, UDPPacketReader reader) {
     
    335424        PeerTestState test = _currentTest;
    336425        if ( (test != null) && (test.getNonce() == nonce) ) {
     426            // we are Alice
    337427            receiveTestReply(from, testInfo);
    338428            return;
    339429        }
    340        
     430
     431        // we are Bob or Charlie
     432
    341433        if ( (testInfo.readIPSize() > 0) && (testPort > 0) ) {
    342434            testIP = new byte[testInfo.readIPSize()];
     
    361453                } else {
    362454                    if (_log.shouldLog(Log.DEBUG))
    363                         _log.debug("We are charlie, as te testIP/port is " + RemoteHostId.toString(testIP) + ":" + testPort + " and the state is unknown for " + nonce);
     455                        _log.debug("We are charlie, as the testIP/port is " + RemoteHostId.toString(testIP) + ":" + testPort + " and the state is unknown for " + nonce);
    364456                    // we are charlie, since alice never sends us her IP and port, only bob does (and,
    365457                    // erm, we're not alice, since it isn't our nonce)
     
    389481    }
    390482   
     483    // Below here are methods for when we are Bob or Charlie
     484
    391485    private static final int MAX_RELAYED_PER_TEST = 5;
    392486   
  • router/java/src/net/i2p/router/transport/udp/UDPTransport.java

    r060f4e6 r01e8743  
    20602060    }
    20612061   
    2062     private static final String KEY = "<h3>Definitions:</h3><div class=\"configure\">" +
     2062    private static final String KEY = "<h3>Definitions</h3><div class=\"configure\">" +
    20632063        "<p><b id=\"def.peer\">Peer</b>: the remote peer.<br>\n" +
    20642064        "<b id=\"def.dir\">Dir</b>: v means they offer to introduce us, ^ means we offer to introduce them.<br>\n" +
Note: See TracChangeset for help on using the changeset viewer.