propagate from branch 'i2p.i2p' (head 45c85fec6458cd0d1a6a6fa2d34b10ee2b9f215c)

to branch 'i2p.i2p.zzz.test2' (head 3ee9968e19867bebb063a98da1184ff4426626cd)
This commit is contained in:
zzz
2016-01-19 01:13:09 +00:00
387 changed files with 37516 additions and 24053 deletions
+4
View File
@@ -23,6 +23,7 @@ trans.sv_SE = apps/i2ptunnel/locale/messages_sv.po
trans.uk_UA = apps/i2ptunnel/locale/messages_uk.po
trans.vi = apps/i2ptunnel/locale/messages_vi.po
trans.zh_CN = apps/i2ptunnel/locale/messages_zh.po
trans.zh_TW = apps/i2ptunnel/locale/messages_zh_TW.po
[I2P.proxy]
source_file = apps/i2ptunnel/locale-proxy/messages_en.po
@@ -76,6 +77,7 @@ trans.tr_TR = apps/routerconsole/locale/messages_tr.po
trans.uk_UA = apps/routerconsole/locale/messages_uk.po
trans.vi = apps/routerconsole/locale/messages_vi.po
trans.zh_CN = apps/routerconsole/locale/messages_zh.po
trans.zh_TW = apps/routerconsole/locale/messages_zh_TW.po
[I2P.welcome]
source_file = apps/routerconsole/locale-news/messages_en.po
@@ -105,6 +107,7 @@ trans.sv_SE = apps/routerconsole/locale-news/messages_sv.po
trans.tr_TR = apps/routerconsole/locale-news/messages_tr.po
trans.uk_UA = apps/routerconsole/locale-news/messages_uk.po
trans.zh_CN = apps/routerconsole/locale-news/messages_zh.po
trans.zh_TW = apps/routerconsole/locale-news/messages_zh_TW.po
[I2P.countries]
type = PO
@@ -136,6 +139,7 @@ trans.uk_UA = apps/routerconsole/locale-countries/messages_uk.po
trans.tr_TR = apps/routerconsole/locale-countries/messages_tr.po
trans.vi = apps/routerconsole/locale-countries/messages_vi.po
trans.zh_CN = apps/routerconsole/locale-countries/messages_zh.po
trans.zh_TW = apps/routerconsole/locale-countries/messages_zh_TW.po
[I2P.i2psnark]
source_file = apps/i2psnark/locale/messages_en.po
+2 -1
View File
@@ -6,7 +6,8 @@ Prerequisites to build from source:
Certain subsystems for embedded (core, router, mstreaming, streaming, i2ptunnel) require only Java 1.6
Apache Ant 1.7.0 or higher
The xgettext, msgfmt, and msgmerge tools installed
from the GNU gettext package http://www.gnu.org/software/gettext/
from the GNU gettext package http://www.gnu.org/software/gettext/
Build environment must use a UTF-8 locale.
To build and install I2P from source, you must first build
and package up the appropriate installer by running:
+1
View File
@@ -5,6 +5,7 @@ Prerequisites to build from source:
Apache Ant 1.7.0 or higher
The xgettext, msgfmt, and msgmerge tools installed
from the GNU gettext package http://www.gnu.org/software/gettext/
Build environment must use a UTF-8 locale.
To build:
On x86 systems do:
@@ -66,7 +66,7 @@ public class Main {
}
static void wrtxt(OutputStream CMDout, String s) throws IOException {
CMDout.write(s.getBytes());
CMDout.write(DataHelper.getUTF8(s));
CMDout.write('\n');
CMDout.flush();
}
@@ -63,7 +63,7 @@ public class Main {
}
static void wrtxt(OutputStream CMDout, String s) throws IOException {
CMDout.write(s.getBytes());
CMDout.write(DataHelper.getUTF8(s));
CMDout.write('\n');
CMDout.flush();
}
+2 -1
View File
@@ -21,6 +21,7 @@ import java.net.Socket;
import java.util.concurrent.atomic.AtomicBoolean;
import net.i2p.client.streaming.I2PSocket;
import net.i2p.data.DataHelper;
import net.i2p.util.I2PAppThread;
/**
@@ -106,7 +107,7 @@ public class I2PtoTCP implements Runnable {
if (tell) {
// tell who is connecting
out.write(I2P.getPeerDestination().toBase64().getBytes());
out.write(DataHelper.getASCII(I2P.getPeerDestination().toBase64()));
out.write(10); // nl
out.flush(); // not really needed, but...
}
@@ -11,6 +11,7 @@ import java.util.Iterator;
import java.util.Set;
import net.i2p.data.Hash;
import net.i2p.data.DataHelper
import net.i2p.router.Router;
import net.i2p.router.RouterContext;
import net.i2p.util.I2PThread;
@@ -47,7 +48,7 @@ class AdminRunner implements Runnable {
reply(out, "this is not a website");
} else if ( (command.indexOf("routerStats.html") >= 0) || (command.indexOf("oldstats.jsp") >= 0) ) {
try {
out.write("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n".getBytes());
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
_generator.generateStatsPage(new OutputStreamWriter(out));
out.close();
} catch (IOException ioe) {
@@ -61,7 +62,7 @@ class AdminRunner implements Runnable {
reply(out, shutdown(command));
} else if (true || command.indexOf("routerConsole.html") > 0) {
try {
out.write("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n".getBytes());
out.write(DataHelper.getASCII("HTTP/1.1 200 OK\nConnection: close\nCache-control: no-cache\nContent-type: text/html\n\n"));
_context.router().renderStatusHTML(new OutputStreamWriter(out));
out.close();
} catch (IOException ioe) {
@@ -80,7 +81,7 @@ class AdminRunner implements Runnable {
reply.append("Content-type: text/html\n\n");
reply.append(content);
try {
out.write(reply.toString().getBytes());
out.write(DataHelper.getASCII(reply.toString()));
out.close();
} catch (IOException ioe) {
if (_log.shouldLog(Log.WARN))
@@ -97,7 +98,7 @@ class AdminRunner implements Runnable {
reply.append("Content-type: text/plain\n\n");
reply.append(content);
try {
out.write(reply.toString().getBytes());
out.write(DataHelper.getASCII(reply.toString()));
out.close();
} catch (IOException ioe) {
if (_log.shouldLog(Log.WARN))
+3 -3
View File
@@ -1,4 +1,4 @@
# Last Modified: Sun Apr 12 22:08:32 2015
#Last Modified: Sun Dec 06 12:30:32 2015
# vim:syntax=apparmor et ts=8 sw=4
#include <tunables/global>
@@ -15,7 +15,7 @@ $INSTALL_PATH/{i2prouter,runplain.sh} flags=(complain) {
$INSTALL_PATH/ r,
$INSTALL_PATH/{i2psvc,wrapper} rmix,
owner $INSTALL_PATH/** rwklm,
owner $INSTALL_PATH/** rwkm,
# Needed for Java
owner @{PROC} r,
@@ -57,7 +57,7 @@ $INSTALL_PATH/{i2prouter,runplain.sh} flags=(complain) {
/usr/share/java/eclipse-ecj-*.jar r,
/{,var/}tmp/ rwm,
owner /{,var/}tmp/** rwklm,
owner /{,var/}tmp/** rwkm,
/{,usr/}bin/{,b,d}ash rix,
/{,usr/}bin/cat rix,
@@ -24,6 +24,7 @@ import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ConnectException;
import net.i2p.I2PAppContext;
import net.i2p.I2PException;
@@ -213,6 +214,20 @@ class ConnectionAcceptor implements Runnable
}
}
}
catch (ConnectException ioe)
{
// This is presumed to be due to socket closing by I2PSnarkUtil.disconnect(),
// which does not currently call our halt(), although it should
if (_log.shouldWarn())
_log.warn("Error while accepting", ioe);
synchronized(this) {
if (!stop) {
locked_halt();
thread = null;
stop = true;
}
}
}
catch (IOException ioe)
{
int level = stop ? Log.WARN : Log.ERROR;
@@ -42,7 +42,7 @@ abstract class ExtensionHandler {
* @param dht advertise DHT capability
* @return bencoded outgoing handshake message
*/
public static byte[] getHandshake(int metasize, boolean pexAndMetadata, boolean dht) {
public static byte[] getHandshake(int metasize, boolean pexAndMetadata, boolean dht, boolean uploadOnly) {
Map<String, Object> handshake = new HashMap<String, Object>();
Map<String, Integer> m = new HashMap<String, Integer>();
if (pexAndMetadata) {
@@ -59,6 +59,9 @@ abstract class ExtensionHandler {
handshake.put("p", Integer.valueOf(TrackerClient.PORT));
handshake.put("v", "I2PSnark");
handshake.put("reqq", Integer.valueOf(5));
// BEP 21
if (uploadOnly)
handshake.put("upload_only", Integer.valueOf(1));
return BEncoder.bencode(handshake);
}
@@ -75,7 +75,7 @@ public class I2PSnarkUtil {
private static final int EEPGET_CONNECT_TIMEOUT_SHORT = 5*1000;
public static final int DEFAULT_STARTUP_DELAY = 3;
public static final boolean DEFAULT_USE_OPENTRACKERS = true;
public static final int MAX_CONNECTIONS = 16; // per torrent
public static final int MAX_CONNECTIONS = 24; // per torrent
public static final String PROP_MAX_BW = "i2cp.outboundBytesPerSecond";
public static final boolean DEFAULT_USE_DHT = true;
public static final String EEPGET_USER_AGENT = "I2PSnark";
@@ -661,7 +661,7 @@ public class I2PSnarkUtil {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -120,10 +120,10 @@ class IdleChecker extends SimpleTimer2.TimedEvent {
Map<String, String> opts = _util.getI2CPOptions();
String i = opts.get("inbound.quantity");
if (i == null)
i = "3";
i = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY);
String o = opts.get("outbound.quantity");
if (o == null)
o = "3";
o = Integer.toString(SnarkManager.DEFAULT_TUNNEL_QUANTITY);
String ib = opts.get("inbound.backupQuantity");
if (ib == null)
ib = "0";
@@ -217,9 +217,11 @@ public class Peer implements Comparable<Peer>
*
* If the given BitField is non-null it is send to the peer as first
* message.
*
* @param uploadOnly if we are complete with skipped files, i.e. a partial seed
*/
public void runConnection(I2PSnarkUtil util, PeerListener listener, BitField bitfield, MagnetState mState)
{
public void runConnection(I2PSnarkUtil util, PeerListener listener, BitField bitfield,
MagnetState mState, boolean uploadOnly) {
if (state != null)
throw new IllegalStateException("Peer already started");
@@ -275,17 +277,9 @@ public class Peer implements Comparable<Peer>
int metasize = metainfo != null ? metainfo.getInfoBytes().length : -1;
boolean pexAndMetadata = metainfo == null || !metainfo.isPrivate();
boolean dht = util.getDHT() != null;
out.sendExtension(0, ExtensionHandler.getHandshake(metasize, pexAndMetadata, dht));
out.sendExtension(0, ExtensionHandler.getHandshake(metasize, pexAndMetadata, dht, uploadOnly));
}
// Old DHT PORT message
//if ((options & OPTION_I2P_DHT) != 0 && util.getDHT() != null) {
// if (_log.shouldLog(Log.DEBUG))
// _log.debug("Peer supports DHT, sending PORT message");
// int port = util.getDHT().getPort();
// out.sendPort(port);
//}
// Send our bitmap
if (bitfield != null)
s.out.sendBitfield(bitfield);
@@ -70,7 +70,7 @@ class PeerCoordinator implements PeerListener
// package local for access by CheckDownLoadersTask
final static long CHECK_PERIOD = 40*1000; // 40 seconds
final static int MAX_UPLOADERS = 6;
final static int MAX_UPLOADERS = 8;
public static final long MAX_INACTIVE = 8*60*1000;
/**
@@ -403,7 +403,7 @@ class PeerCoordinator implements PeerListener
* Formerly used to
* reduce max if huge pieces to keep from ooming when leeching
* but now we don't
* @return usually 16
* @return usually I2PSnarkUtil.MAX_CONNECTIONS
*/
private int getMaxConnections() {
if (metainfo == null)
@@ -604,11 +604,13 @@ class PeerCoordinator implements PeerListener
bitfield = storage.getBitField();
else
bitfield = null;
// if we aren't a seed but we don't want any more
final boolean partialComplete = wantedBytes == 0 && bitfield != null && !bitfield.complete();
Runnable r = new Runnable()
{
public void run()
{
peer.runConnection(_util, listener, bitfield, magnetState);
peer.runConnection(_util, listener, bitfield, magnetState, partialComplete);
}
};
String threadName = "Snark peer " + peer.toString();
@@ -1329,7 +1329,7 @@ public class Snark
* coordinatorListener
*/
final static int MIN_TOTAL_UPLOADERS = 4;
final static int MAX_TOTAL_UPLOADERS = 10;
final static int MAX_TOTAL_UPLOADERS = 20;
public boolean overUploadLimit(int uploaders) {
if (_peerCoordinatorSet == null || uploaders <= 0)
@@ -133,6 +133,7 @@ public class SnarkManager implements CompleteListener {
public static final int DEFAULT_STARTUP_DELAY = 3;
public static final int DEFAULT_REFRESH_DELAY_SECS = 60;
private static final int DEFAULT_PAGE_SIZE = 50;
public static final int DEFAULT_TUNNEL_QUANTITY = 3;
public static final String CONFIG_DIR_SUFFIX = ".d";
private static final String SUBDIR_PREFIX = "s";
private static final String B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-~";
@@ -610,7 +611,9 @@ public class SnarkManager implements CompleteListener {
if (!_config.containsKey(PROP_I2CP_PORT))
_config.setProperty(PROP_I2CP_PORT, "7654");
if (!_config.containsKey(PROP_I2CP_OPTS))
_config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3 inbound.quantity=3 outbound.quantity=3");
_config.setProperty(PROP_I2CP_OPTS, "inbound.length=3 outbound.length=3" +
" inbound.quantity=" + DEFAULT_TUNNEL_QUANTITY +
" outbound.quantity=" + DEFAULT_TUNNEL_QUANTITY);
//if (!_config.containsKey(PROP_EEP_HOST))
// _config.setProperty(PROP_EEP_HOST, "127.0.0.1");
//if (!_config.containsKey(PROP_EEP_PORT))
@@ -80,7 +80,7 @@ public class Storage implements Closeable
/** bigger than this will be rejected */
public static final int MAX_PIECE_SIZE = 16*1024*1024;
/** The maximum number of pieces in a torrent. */
public static final int MAX_PIECES = 10*1024;
public static final int MAX_PIECES = 32*1024;
public static final long MAX_TOTAL_SIZE = MAX_PIECE_SIZE * (long) MAX_PIECES;
private static final Map<String, String> _filterNameCache = new ConcurrentHashMap<String, String>();
@@ -166,7 +166,7 @@ public class Storage implements Closeable
else
pc_size = DEFAULT_PIECE_SIZE;
int pcs = (int) ((total - 1)/pc_size) + 1;
while (pcs > (MAX_PIECES * 2 / 3) && pc_size < MAX_PIECE_SIZE)
while (pcs > (MAX_PIECES / 3) && pc_size < MAX_PIECE_SIZE)
{
pc_size *= 2;
pcs = (int) ((total - 1)/pc_size) +1;
@@ -907,6 +907,8 @@ public class TrackerClient implements Runnable {
if (!"http".equals(url.getScheme()))
return null;
String host = url.getHost();
if (host == null)
return null;
if (host.endsWith(".i2p"))
return ConvertToHash.getHash(host);
if (host.equals("i2p")) {
@@ -40,6 +40,7 @@ import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import net.i2p.util.SimpleTimer2;
import org.klomp.snark.I2PSnarkUtil;
import org.klomp.snark.SnarkManager;
import org.klomp.snark.TrackerClient;
import org.klomp.snark.bencode.BDecoder;
@@ -128,8 +129,10 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
/** Max number of nodes to return. BEP 5 says 8 */
private static final int K = 8;
/** Max number of peers to return. BEP 5 doesn't say. We'll use the same as I2PSnarkUtil.MAX_CONNECTIONS */
private static final int MAX_WANT = 16;
/** Max number of peers to return. BEP 5 doesn't say.
* We'll use more than I2PSnarkUtil.MAX_CONNECTIONS since lots could be old.
*/
private static final int MAX_WANT = I2PSnarkUtil.MAX_CONNECTIONS * 3 / 2;
/** overloads error codes which start with 201 */
private static final int REPLY_NONE = 0;
@@ -1412,7 +1415,7 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
private List<Hash> receivePeers(NodeInfo nInfo, List<BEValue> peers) throws InvalidBEncodingException {
if (_log.shouldLog(Log.INFO))
_log.info("Rcvd peers from: " + nInfo);
int max = Math.min(MAX_WANT, peers.size());
int max = Math.min(MAX_WANT * 2, peers.size());
List<Hash> rv = new ArrayList<Hash>(max);
for (BEValue bev : peers) {
byte[] b = bev.getBytes();
@@ -31,6 +31,7 @@ import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.util.Log;
import net.i2p.util.SecureFile;
import net.i2p.util.SystemVersion;
import net.i2p.util.Translate;
import org.klomp.snark.I2PSnarkUtil;
@@ -2305,13 +2306,15 @@ public class I2PSnarkServlet extends BasicServlet {
out.write("<tr><td>");
out.write(_t("Inbound Settings"));
out.write(":<td>");
out.write(renderOptions(1, 10, 3, options.remove("inbound.quantity"), "inbound.quantity", TUNNEL));
out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY,
options.remove("inbound.quantity"), "inbound.quantity", TUNNEL));
out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
out.write(renderOptions(0, 4, 3, options.remove("inbound.length"), "inbound.length", HOP));
out.write("<tr><td>");
out.write(_t("Outbound Settings"));
out.write(":<td>");
out.write(renderOptions(1, 10, 3, options.remove("outbound.quantity"), "outbound.quantity", TUNNEL));
out.write(renderOptions(1, 10, SnarkManager.DEFAULT_TUNNEL_QUANTITY,
options.remove("outbound.quantity"), "outbound.quantity", TUNNEL));
out.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
out.write(renderOptions(0, 4, 3, options.remove("outbound.length"), "outbound.length", HOP));
@@ -2800,7 +2803,7 @@ public class I2PSnarkServlet extends BasicServlet {
}
long dat = meta.getCreationDate();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm");
fmt.setTimeZone(DataHelper.getSystemTimeZone(_context));
fmt.setTimeZone(SystemVersion.getSystemTimeZone(_context));
if (dat > 0) {
String date = fmt.format(new Date(dat));
buf.append("<tr><td>");
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+18
View File
@@ -3,6 +3,7 @@
7z = application/x-7z-compressed
ape = audio/x-monkeys-audio
bz2 = application/x-bzip2
cue = application/x-cue
dmg = application/apple-diskimage
epub = application/epub+zip
flac = audio/flac
@@ -17,9 +18,26 @@ mobi = application/x-mobipocket-ebook
mp4 = video/mp4
mpc = audio/x-musepack
nfo = text/plain
odb = application/vnd.oasis.opendocument.database
odc = application/vnd.oasis.opendocument.chart
odf = application/vnd.oasis.opendocument.formula
odg = application/vnd.oasis.opendocument.graphics
odi = application/vnd.oasis.opendocument.image
odm = application/vnd.oasis.opendocument.text-master
odp = application/vnd.oasis.opendocument.presentation
ods = application/vnd.oasis.opendocument.spreadsheet
odt = application/vnd.oasis.opendocument.text
ogm = video/ogg
ogv = video/ogg
oga = audio/ogg
otc = application/vnd.oasis.opendocument.chart-template
otf = application/vnd.oasis.opendocument.formula-template
otg = application/vnd.oasis.opendocument.graphics-template
oth = application/vnd.oasis.opendocument.text-web
oti = application/vnd.oasis.opendocument.image-template
otp = application/vnd.oasis.opendocument.presentation-template
ots = application/vnd.oasis.opendocument.spreadsheet-template
ott = application/vnd.oasis.opendocument.text-template
rar = application/x-rar-compressed
sfv = text/x-sfv
su2 = application/zip
@@ -8,12 +8,12 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.i2p.I2PAppContext;
import net.i2p.data.DataHelper;
import net.i2p.data.Hash;
import net.i2p.util.Clock;
import net.i2p.util.Log;
import net.i2p.util.SimpleTimer2;
import net.i2p.util.SystemVersion;
/**
* Count how often something happens with a particular peer and all peers.
@@ -56,7 +56,7 @@ class ConnThrottler {
_log = log;
// for logging
_fmt = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
_fmt.setTimeZone(DataHelper.getSystemTimeZone(I2PAppContext.getGlobalContext()));
_fmt.setTimeZone(SystemVersion.getSystemTimeZone());
new Cleaner();
}
@@ -186,10 +186,10 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
}
private void initStats() {
_context.statManager().createRateStat("i2ptunnel.client.closeBacklog", "How many pending sockets remain when we close one due to backlog?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.client.closeNoBacklog", "How many pending sockets remain when it was removed prior to backlog timeout?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.client.manageTime", "How long it takes to accept a socket and fire it into an i2ptunnel runner (or queue it for the pool)?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.client.buildRunTime", "How long it takes to run a queued socket into an i2ptunnel runner?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.client.closeBacklog", "How many pending sockets remain when we close one due to backlog?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.client.closeNoBacklog", "How many pending sockets remain when it was removed prior to backlog timeout?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.client.manageTime", "How long it takes to accept a socket and fire it into an i2ptunnel runner (or queue it for the pool)?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.client.buildRunTime", "How long it takes to run a queued socket into an i2ptunnel runner?", "I2PTunnel", new long[] { 60*1000, 10*60*1000, 60*60*1000 });
}
/**
@@ -240,7 +240,7 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R
}
if (user != null && pw != null) {
newRequest.append("Proxy-Authorization: Basic ")
.append(Base64.encode((user + ':' + pw).getBytes(), true)) // true = use standard alphabet
.append(Base64.encode(DataHelper.getUTF8(user + ':' + pw), true)) // true = use standard alphabet
.append("\r\n");
}
}
@@ -265,7 +265,7 @@ public class I2PTunnelConnectClient extends I2PTunnelHTTPClientBase implements R
else
_log.warn(getPrefix(requestId) + "Auth required, sending 407");
}
out.write(getAuthError(result == AuthResult.AUTH_STALE).getBytes());
out.write(DataHelper.getASCII(getAuthError(result == AuthResult.AUTH_STALE)));
s.close();
return;
}
@@ -307,9 +307,9 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn
@Override
public void startRunning() {
// following are for HTTPResponseOutputStream
_context.statManager().createRateStat("i2ptunnel.httpCompressionRatio", "ratio of compressed size to decompressed size after transfer", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpCompressed", "compressed size transferred", "I2PTunnel", new long[] { 60*60*1000 });
_context.statManager().createRateStat("i2ptunnel.httpExpanded", "size transferred after expansion", "I2PTunnel", new long[] { 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.httpCompressionRatio", "ratio of compressed size to decompressed size after transfer", "I2PTunnel", new long[] { 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.httpCompressed", "compressed size transferred", "I2PTunnel", new long[] { 60*60*1000 });
//_context.statManager().createRateStat("i2ptunnel.httpExpanded", "size transferred after expansion", "I2PTunnel", new long[] { 60*60*1000 });
super.startRunning();
if (open) {
this.isr = new InternalSocketRunner(this);
@@ -41,6 +41,7 @@ import net.i2p.util.EventDispatcher;
import net.i2p.util.InternalSocket;
import net.i2p.util.Log;
import net.i2p.util.PasswordManager;
import net.i2p.util.PortMapper;
import net.i2p.util.Translate;
import net.i2p.util.TranslateReader;
@@ -535,7 +536,24 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
while((len = reader.read(buf)) > 0) {
out.append(buf, 0, len);
}
return out.toString();
String rv = out.toString();
// Do we need to replace http://127.0.0.1:7657 console links in the error page?
// Get the registered host and port from the PortMapper.
final String unset = "*unset*";
final String httpHost = ctx.portMapper().getActualHost(PortMapper.SVC_CONSOLE, unset);
final String httpsHost = ctx.portMapper().getActualHost(PortMapper.SVC_HTTPS_CONSOLE, unset);
final int httpPort = ctx.portMapper().getPort(PortMapper.SVC_CONSOLE, 7657);
final int httpsPort = ctx.portMapper().getPort(PortMapper.SVC_HTTPS_CONSOLE, -1);
final boolean httpsOnly = httpsPort > 0 && httpHost.equals(unset) && !httpsHost.equals(unset);
final int port = httpsOnly ? httpsPort : httpPort;
String host = httpsOnly ? httpsHost : httpHost;
if (host.equals(unset))
host = "127.0.0.1";
if (httpsOnly || port != 7657 || !host.equals("127.0.0.1")) {
String url = (httpsOnly ? "https://" : "http://") + host + ':' + port;
rv = rv.replace("http://127.0.0.1:7657", url);
}
return rv;
} finally {
try {
if(reader != null)
@@ -455,7 +455,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
if (allowGZIP && useGZIP) {
t = new CompressedRequestor(s, socket, modifiedHeader, getTunnel().getContext(), _log);
} else {
t = new I2PTunnelRunner(s, socket, slock, null, modifiedHeader.getBytes(),
t = new I2PTunnelRunner(s, socket, slock, null, DataHelper.getUTF8(modifiedHeader),
null, (I2PTunnelRunner.FailCallback) null);
}
// run in the unlimited client pool
@@ -537,7 +537,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
if (_log.shouldLog(Log.INFO))
_log.info("request headers: " + _headers);
serverout.write(_headers.getBytes());
serverout.write(DataHelper.getUTF8(_headers));
browserin = _browser.getInputStream();
// Don't spin off a thread for this except for POSTs
// beware interference with Shoutcast, etc.?
@@ -575,7 +575,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
Map<String, List<String>> headers = readHeaders(null, serverin, command,
SERVER_SKIPHEADERS, _ctx);
String modifiedHeaders = formatHeaders(headers, command);
compressedOut.write(modifiedHeaders.getBytes());
compressedOut.write(DataHelper.getUTF8(modifiedHeaders));
Sender s = new Sender(compressedOut, serverin, "server: server to browser", _log);
if (_log.shouldLog(Log.INFO))
@@ -702,7 +702,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer {
//if (_log.shouldLog(Log.INFO))
// _log.info("Including x-i2p-gzip as the content encoding in the response");
if (shouldCompress())
out.write("Content-encoding: x-i2p-gzip\r\n".getBytes());
out.write(DataHelper.getASCII("Content-encoding: x-i2p-gzip\r\n"));
super.finishHeaders();
}
@@ -129,7 +129,7 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
this.cloakKey = new byte[Hash.HASH_LENGTH];
tunnel.getContext().random().nextBytes(this.cloakKey);
} else {
this.cloakKey = SHA256Generator.getInstance().calculateHash(passphrase.trim().getBytes()).getData();
this.cloakKey = SHA256Generator.getInstance().calculateHash(DataHelper.getUTF8(passphrase.trim())).getData();
}
// get the fake hostmask to use
@@ -159,7 +159,7 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
modifiedRegistration = buf.toString();
}
Socket s = getSocket(socket.getPeerDestination().calculateHash(), socket.getLocalPort());
Thread t = new I2PTunnelRunner(s, socket, slock, null, modifiedRegistration.getBytes(),
Thread t = new I2PTunnelRunner(s, socket, slock, null, DataHelper.getUTF8(modifiedRegistration),
null, (I2PTunnelRunner.FailCallback) null);
// run in the unlimited client pool
//t.start();
@@ -24,6 +24,7 @@ import net.i2p.util.I2PAppThread;
import net.i2p.util.Log;
import net.i2p.util.SecureFile;
import net.i2p.util.SecureFileOutputStream;
import net.i2p.util.SystemVersion;
/**
* Coordinate the runtime operation and configuration of a single I2PTunnel.
@@ -103,10 +104,17 @@ public class TunnelController implements Logging {
* This is guaranteed to be available.
* @since 0.9.17
*/
public static final SigType PREFERRED_SIGTYPE = SigType.ECDSA_SHA256_P256.isAvailable() ?
SigType.ECDSA_SHA256_P256 :
SigType.DSA_SHA1;
public static final SigType PREFERRED_SIGTYPE;
static {
if (SystemVersion.isARM() || SystemVersion.isGNU() || SystemVersion.isAndroid()) {
if (SigType.ECDSA_SHA256_P256.isAvailable())
PREFERRED_SIGTYPE = SigType.ECDSA_SHA256_P256;
else
PREFERRED_SIGTYPE = SigType.DSA_SHA1;
} else {
PREFERRED_SIGTYPE = SigType.EdDSA_SHA512_Ed25519;
}
}
/**
* Create a new controller for a tunnel out of the specific config options.
@@ -185,8 +193,10 @@ public class TunnelController implements Logging {
if (backupDir.isDirectory() || backupDir.mkdir()) {
String name = b32 + '-' + I2PAppContext.getGlobalContext().clock().now() + ".dat";
File backup = new File(backupDir, name);
if (FileUtil.copy(keyFile, backup, false, true))
if (FileUtil.copy(keyFile, backup, false, true)) {
SecureFileOutputStream.setPerms(backup);
log("Private key backup saved to " + backup.getAbsolutePath());
}
}
} catch (I2PException ie) {
if (_log.shouldLog(Log.ERROR))
@@ -55,7 +55,7 @@ public class SOCKSHeader {
this.header = new byte[beg.length + 60 + end.length];
System.arraycopy(this.header, 0, beg, 0, beg.length);
String b32 = dest.toBase32();
System.arraycopy(this.header, beg.length, b32.getBytes(), 0, 60);
System.arraycopy(this.header, beg.length, DataHelper.getASCII(b32), 0, 60);
System.arraycopy(this.header, beg.length + 60, end, 0, end.length);
}
@@ -12,6 +12,7 @@ import java.io.IOException;
import java.net.Socket;
import java.util.Properties;
import net.i2p.data.DataHelper;
import net.i2p.i2ptunnel.I2PTunnelHTTPClientBase;
/**
@@ -63,7 +64,7 @@ public class SOCKSServerFactory {
case 'H':
case 'P':
DataOutputStream out = new DataOutputStream(s.getOutputStream());
out.write(ERR_REQUEST_DENIED.getBytes());
out.write(DataHelper.getASCII(ERR_REQUEST_DENIED));
throw new SOCKSException("HTTP request to socks");
default:
throw new SOCKSException("SOCKS protocol version not supported (" + Integer.toHexString(socksVer) + ")");
@@ -32,7 +32,7 @@ public class Messages {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
+9 -9
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P i2ptunnel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-14 08:33+0000\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2010-06-15 14:09+0100\n"
"Last-Translator: duck <duck@mail.i2p>\n"
"Language-Team: duck <duck@mail.i2p>\n"
@@ -449,39 +449,39 @@ msgid ""
"\"{1}\">here</a>."
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1119
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1121
msgid "Destination lease set not found"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1271
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1273
msgid "Host"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1275
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1277
msgid "Base 32"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1279
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1281
msgid "Destination"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1285
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1287
#, java-format
msgid "Continue to {0} without saving"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1291
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1293
#, java-format
msgid "Save {0} to router address book and continue to website"
msgstr ""
#. only blockfile supports multiple books
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1294
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1296
#, java-format
msgid "Save {0} to master address book and continue to website"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1295
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1297
#, java-format
msgid "Save {0} to private address book and continue to website"
msgstr ""
+11 -11
View File
@@ -17,10 +17,10 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-14 08:33+0000\n"
"PO-Revision-Date: 2015-05-06 20:09+0000\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2015-11-15 12:23+0000\n"
"Last-Translator: brianhopes <voganc-12@live.ru>\n"
"Language-Team: Russian (Russia) (http://www.transifex.com/projects/p/I2P/language/ru_RU/)\n"
"Language-Team: Russian (Russia) (http://www.transifex.com/otf/I2P/language/ru_RU/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -460,39 +460,39 @@ msgid ""
"click <a href=\"{1}\">here</a>."
msgstr "Для перехода по ссылке из локальной адресной книги, нажмите <a href=\"{0}\">здесь</a>. Для перехода по новой addresshelper-ссылке, нажмите <a href=\"{1}\">здесь</a>."
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1119
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1121
msgid "Destination lease set not found"
msgstr "LeaseSet для адреса назначения не найден"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1271
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1273
msgid "Host"
msgstr "Адрес"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1275
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1277
msgid "Base 32"
msgstr "Base 32"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1279
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1281
msgid "Destination"
msgstr "Адрес назначения"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1285
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1287
#, java-format
msgid "Continue to {0} without saving"
msgstr "Продолжить переход к {0} без сохранения"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1291
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1293
#, java-format
msgid "Save {0} to router address book and continue to website"
msgstr "Сохранить {0} в адресную книгу маршрутизатора и перейти к сайту"
#. only blockfile supports multiple books
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1294
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1296
#, java-format
msgid "Save {0} to master address book and continue to website"
msgstr "Сохранить {0} в основную адресную книгу и перейти к сайту"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1295
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1297
#, java-format
msgid "Save {0} to private address book and continue to website"
msgstr "Сохранить {0} в приватную адресную книгу и перейти к сайту"
+15 -14
View File
@@ -4,6 +4,7 @@
# To contribute translations, see http://www.i2p2.de/newdevelopers
#
# Translators:
# Anders Nilsson <locally@devode.se>, 2015
# Calle Rundgren <samaire@samaire.net>, 2013
# cacapo <handelsehorisont@gmail.com>, 2015
# hottuna <i2p@robertfoss.se>, 2013
@@ -13,10 +14,10 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-14 08:33+0000\n"
"PO-Revision-Date: 2015-06-06 18:32+0000\n"
"Last-Translator: cacapo <handelsehorisont@gmail.com>\n"
"Language-Team: Swedish (Sweden) (http://www.transifex.com/projects/p/I2P/language/sv_SE/)\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2015-11-08 21:24+0000\n"
"Last-Translator: Anders Nilsson <locally@devode.se>\n"
"Language-Team: Swedish (Sweden) (http://www.transifex.com/otf/I2P/language/sv_SE/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -281,7 +282,7 @@ msgstr "Webbsidan var inte nåbar."
msgid ""
"The website is offline, there is network congestion, or your router is not "
"yet well-integrated with peers."
msgstr "Webbsidan är offline, nätverket är under stor belastning eller så är din router inte välintegrerad med peers."
msgstr "Webbsidan är offline, nätverket är under stor belastning eller så är din router inte välintegrerad med noder."
#: ../java/build/Proxy.java:106 ../java/build/Proxy.java:112
msgid "Warning: Invalid Destination"
@@ -410,7 +411,7 @@ msgstr "HTTP Utproxyn hittades ej."
msgid ""
"It is offline, there is network congestion, or your router is not yet well-"
"integrated with peers."
msgstr "Den är antingen offline, nätverket är under stor belastning eller så är din router ännu inte väl integrerad med peers."
msgstr "Den är antingen offline, nätverket är under stor belastning eller så är din router ännu inte väl integrerad med noder."
#: ../java/build/Proxy.java:196
msgid "Proxy Authorization Required"
@@ -456,39 +457,39 @@ msgid ""
"click <a href=\"{1}\">here</a>."
msgstr "För att besöka målet i din värd databas href=\"{0}\"> klicka <a här </ a>. För att besöka de motstridiga hjälpaddresserna,<a href=\"{1}\"> klicka <a här </ a>."
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1119
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1121
msgid "Destination lease set not found"
msgstr "Destinationens leaseset kunde inte hittas"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1271
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1273
msgid "Host"
msgstr "Värd"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1275
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1277
msgid "Base 32"
msgstr "Bas 32"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1279
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1281
msgid "Destination"
msgstr "Mål"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1285
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1287
#, java-format
msgid "Continue to {0} without saving"
msgstr "Fortsätt till {0} utan att spara"
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1291
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1293
#, java-format
msgid "Save {0} to router address book and continue to website"
msgstr "Spara {0} till routerns adressbok och fortsätt till webbsidan."
#. only blockfile supports multiple books
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1294
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1296
#, java-format
msgid "Save {0} to master address book and continue to website"
msgstr "Spara {0} till huvudadressboken och fortsätt till webbsidan."
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1295
#: ../java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java:1297
#, java-format
msgid "Save {0} to private address book and continue to website"
msgstr "Spara {0} till privata adressboken och fortsätt till webbsidan."
+55 -55
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P i2ptunnel\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-29 14:30+0000\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2010-06-15 14:09+0100\n"
"Last-Translator: duck <duck@mail.i2p>\n"
"Language-Team: duck <duck@mail.i2p>\n"
@@ -146,7 +146,7 @@ msgid "HTTP bidir"
msgstr ""
#: ../java/src/net/i2p/i2ptunnel/web/IndexBean.java:445
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:317
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:318
msgid "Host not set"
msgstr ""
@@ -174,25 +174,25 @@ msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:128
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:142
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:273
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:288
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:129
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:143
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:274
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:289
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:329
msgid "Name"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:277
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:306
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:278
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:307
msgid "Type"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:257
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:426
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:258
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:427
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:333
msgid "Description"
msgstr ""
@@ -441,8 +441,8 @@ msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:451
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:198
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:443
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:275
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:297
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:276
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:298
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:437
msgid "Port"
msgstr ""
@@ -722,86 +722,86 @@ msgstr ""
msgid "Refresh"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:111
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:112
msgid "Tunnel Wizard"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:115
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:116
msgid "Stop All"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:119
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:120
msgid "Start All"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:123
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:124
msgid "Restart All"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:126
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:127
msgid "I2P Hidden Services"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:130
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:151
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:131
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:152
msgid "Points at"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:132
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:184
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:188
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:133
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:185
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:189
msgid "Preview"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:134
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:208
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:281
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:324
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:135
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:209
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:282
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:325
msgid "Status"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:194
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:195
msgid "Base32 Address"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:202
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:203
msgid "No Preview"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:215
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:331
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:216
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:332
msgid "Starting..."
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:222
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:236
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:338
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:352
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:366
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:223
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:237
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:339
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:353
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:367
msgid "Stop"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:229
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:359
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:230
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:360
msgid "Running"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:243
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:373
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:244
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:374
msgid "Stopped"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:250
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:380
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:251
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:381
msgid "Start"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:265
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:266
msgid "New hidden service"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:267
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:436
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:437
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:226
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:298
@@ -810,41 +810,41 @@ msgstr ""
msgid "Standard"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:269
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:438
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:270
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:439
msgid "Create"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:271
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:272
msgid "I2P Client Tunnels"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:279
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:310
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:280
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:311
msgid "Interface"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:345
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:346
msgid "Standby"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:389
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:390
msgid "Outproxy"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:392
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:393
msgid "Destination"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:399
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:400
msgid "internal plugin"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:418
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:419
msgid "none"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:434
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:435
msgid "New client tunnel"
msgstr ""
+57 -57
View File
@@ -13,10 +13,10 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-29 14:30+0000\n"
"PO-Revision-Date: 2015-03-29 14:31+0000\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2015-11-07 10:02+0000\n"
"Last-Translator: kytv <killyourtv@i2pmail.org>\n"
"Language-Team: Dutch (http://www.transifex.com/projects/p/I2P/language/nl/)\n"
"Language-Team: Dutch (http://www.transifex.com/otf/I2P/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -151,7 +151,7 @@ msgid "HTTP bidir"
msgstr "HTTP bidir"
#: ../java/src/net/i2p/i2ptunnel/web/IndexBean.java:445
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:317
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:318
msgid "Host not set"
msgstr "Host niet opgegeven"
@@ -179,25 +179,25 @@ msgstr "Nieuwe proxy instellingen"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:128
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:142
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:273
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:288
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:129
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:143
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:274
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:289
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:329
msgid "Name"
msgstr "Naam"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:277
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:306
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:278
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:307
msgid "Type"
msgstr "Type"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:257
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:426
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:258
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:427
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:333
msgid "Description"
msgstr "Omschrijving"
@@ -446,8 +446,8 @@ msgstr "Host"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:451
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:198
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:443
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:275
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:297
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:276
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:298
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:437
msgid "Port"
msgstr "Poort"
@@ -727,86 +727,86 @@ msgstr "Statusberichten"
msgid "Refresh"
msgstr "Verversen"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:111
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:112
msgid "Tunnel Wizard"
msgstr "Tunnel-setup"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:115
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:116
msgid "Stop All"
msgstr "Alles stoppen"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:119
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:120
msgid "Start All"
msgstr "Alles starten"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:123
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:124
msgid "Restart All"
msgstr "Alles herstarten"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:126
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:127
msgid "I2P Hidden Services"
msgstr "I2P verborgen diensten"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:130
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:151
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:131
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:152
msgid "Points at"
msgstr "Verwijst naar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:132
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:184
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:188
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:133
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:185
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:189
msgid "Preview"
msgstr "Voorbeeld"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:134
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:208
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:281
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:324
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:135
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:209
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:282
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:325
msgid "Status"
msgstr "Status"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:194
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:195
msgid "Base32 Address"
msgstr "Base32-adres"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:202
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:203
msgid "No Preview"
msgstr "Geen voorbeeld"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:215
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:331
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:216
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:332
msgid "Starting..."
msgstr "Bezig met starten..."
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:222
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:236
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:338
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:352
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:366
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:223
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:237
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:339
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:353
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:367
msgid "Stop"
msgstr "Stop"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:229
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:359
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:230
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:360
msgid "Running"
msgstr "Draait"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:243
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:373
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:244
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:374
msgid "Stopped"
msgstr "Gestopt"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:250
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:380
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:251
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:381
msgid "Start"
msgstr "Start"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:265
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:266
msgid "New hidden service"
msgstr "Nieuwe verborgen dienst"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:267
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:436
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:437
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:226
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:298
@@ -815,41 +815,41 @@ msgstr "Nieuwe verborgen dienst"
msgid "Standard"
msgstr "Standaard"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:269
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:438
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:270
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:439
msgid "Create"
msgstr "Aanmaken"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:271
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:272
msgid "I2P Client Tunnels"
msgstr "I2P cliënt-tunnels"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:279
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:310
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:280
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:311
msgid "Interface"
msgstr "Interface"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:345
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:346
msgid "Standby"
msgstr "Stand-by"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:389
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:390
msgid "Outproxy"
msgstr "Uitgaande proxy"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:392
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:393
msgid "Destination"
msgstr "Destination"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:399
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:400
msgid "internal plugin"
msgstr "interne plugin"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:418
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:419
msgid "none"
msgstr "geen"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:434
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:435
msgid "New client tunnel"
msgstr "Nieuwe cliënt-tunnel"
+58 -58
View File
@@ -12,10 +12,10 @@ msgid ""
msgstr ""
"Project-Id-Version: I2P\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-03-29 14:30+0000\n"
"PO-Revision-Date: 2015-03-29 14:31+0000\n"
"POT-Creation-Date: 2015-11-05 17:12+0000\n"
"PO-Revision-Date: 2015-11-09 03:40+0000\n"
"Last-Translator: kytv <killyourtv@i2pmail.org>\n"
"Language-Team: Portuguese (http://www.transifex.com/projects/p/I2P/language/pt/)\n"
"Language-Team: Portuguese (http://www.transifex.com/otf/I2P/language/pt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@@ -150,7 +150,7 @@ msgid "HTTP bidir"
msgstr "HTTP bidir"
#: ../java/src/net/i2p/i2ptunnel/web/IndexBean.java:445
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:317
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:318
msgid "Host not set"
msgstr "Host por definir"
@@ -162,7 +162,7 @@ msgstr "Endereço inválido"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:82
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:85
msgid "Hidden Services Manager"
msgstr ""
msgstr "Gerenciador de Serviços Ocultos"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:86
msgid "Edit Client Tunnel"
@@ -178,25 +178,25 @@ msgstr "Novas definições da proxy"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:162
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:128
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:142
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:273
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:288
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:129
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:143
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:274
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:289
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:329
msgid "Name"
msgstr "Nome"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:166
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:277
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:306
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:278
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:307
msgid "Type"
msgstr "Tipo"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:170
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:257
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:426
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:258
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:427
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:333
msgid "Description"
msgstr "Descrição"
@@ -445,8 +445,8 @@ msgstr "Host"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editClient_jsp.java:451
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:198
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/editServer_jsp.java:443
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:275
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:297
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:276
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:298
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:437
msgid "Port"
msgstr "Porta"
@@ -726,86 +726,86 @@ msgstr "Mensagens de status"
msgid "Refresh"
msgstr "Atualizar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:111
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:112
msgid "Tunnel Wizard"
msgstr "Assistente de Túneis"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:115
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:116
msgid "Stop All"
msgstr "Parar Todos"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:119
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:120
msgid "Start All"
msgstr "Iniciar Todos"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:123
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:124
msgid "Restart All"
msgstr "Reiniciar Todos"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:126
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:127
msgid "I2P Hidden Services"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:130
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:151
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:131
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:152
msgid "Points at"
msgstr "Aponta para"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:132
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:184
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:188
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:133
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:185
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:189
msgid "Preview"
msgstr "Visualizar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:134
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:208
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:281
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:324
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:135
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:209
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:282
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:325
msgid "Status"
msgstr "Status"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:194
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:195
msgid "Base32 Address"
msgstr "Endereço Base32"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:202
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:203
msgid "No Preview"
msgstr "Sem visualização"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:215
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:331
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:216
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:332
msgid "Starting..."
msgstr "Iniciando..."
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:222
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:236
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:338
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:352
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:366
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:223
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:237
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:339
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:353
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:367
msgid "Stop"
msgstr "Parar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:229
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:359
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:230
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:360
msgid "Running"
msgstr "Executando"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:243
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:373
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:244
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:374
msgid "Stopped"
msgstr "Parado"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:250
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:380
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:251
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:381
msgid "Start"
msgstr "Iniciar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:265
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:266
msgid "New hidden service"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:267
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:436
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:437
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:226
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:268
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/wizard_jsp.java:298
@@ -814,41 +814,41 @@ msgstr ""
msgid "Standard"
msgstr "Padrão"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:269
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:438
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:270
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:439
msgid "Create"
msgstr "Criar"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:271
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:272
msgid "I2P Client Tunnels"
msgstr "Túneis de cliente I2P"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:279
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:310
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:280
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:311
msgid "Interface"
msgstr "Interface"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:345
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:346
msgid "Standby"
msgstr "Em espera"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:389
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:390
msgid "Outproxy"
msgstr "Proxy de saída"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:392
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:393
msgid "Destination"
msgstr "Destino"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:399
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:400
msgid "internal plugin"
msgstr ""
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:418
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:419
msgid "none"
msgstr "nenhum"
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:434
#: ../jsp/WEB-INF/classes/net/i2p/i2ptunnel/jsp/index_jsp.java:435
msgid "New client tunnel"
msgstr "Novo túnel de cliente"
@@ -31,12 +31,12 @@ public class I2PLogger implements Logger
{
private final Log _log;
StringBuilder _buffer = new StringBuilder();
private final StringBuilder _buffer = new StringBuilder();
static {
//static {
// So people don't wonder where the logs went
System.out.println("INFO: Jetty " + Server.getVersion() + " logging to I2P logs using class " + Server.class.getName());
}
//System.out.println("INFO: Jetty " + Server.getVersion() + " logging to I2P logs using class " + Server.class.getName());
//}
public I2PLogger()
{
@@ -76,6 +76,7 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
private boolean _logLatency = false;
private boolean _logCookies = false;
private boolean _logServer = false;
private boolean _b64;
private transient OutputStream _out;
private transient OutputStream _fileOut;
@@ -242,6 +243,15 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
_preferProxiedForAddress = preferProxiedForAddress;
}
/**
* @param b64 true to enable base 64 logging. False for base 32 logging. Default false.
* @since 0.9.24
*/
public void setB64(boolean b64)
{
_b64 = b64;
}
/* ------------------------------------------------------------ */
public void log(Request request, Response response)
{
@@ -280,11 +290,15 @@ public class I2PRequestLog extends AbstractLifeCycle implements RequestLog
}
if (addr == null) {
// TODO offer B32 option
addr = request.getHeader("X-I2P-DestHash");
if(addr != null)
addr += ".i2p";
else
if (_b64) {
addr = request.getHeader("X-I2P-DestHash");
if (addr != null)
addr += ".i2p";
} else {
// 52chars.b32.i2p
addr = request.getHeader("X-I2P-DestB32");
}
if (addr == null)
addr = request.getRemoteAddr();
}
+1
View File
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/junit"/>
<classpathentry kind="src" path="demo"/>
<classpathentry combineaccessrules="false" kind="src" path="/i2p_sdk"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/obj"/>
+150 -8
View File
@@ -40,21 +40,21 @@
</javac>
</target>
<target name="compileTest" depends="jar">
<mkdir dir="./buildTest" />
<mkdir dir="./buildTest/obj" />
<target name="compileDemo" depends="jar">
<mkdir dir="./buildDemo" />
<mkdir dir="./buildDemo/obj" />
<javac
srcdir="./test/junit"
srcdir="./demo"
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
destdir="./buildTest/obj"
destdir="./buildDemo/obj"
classpath="../../../core/java/build/i2p.jar:./build/mstreaming.jar" >
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<target name="jarTest" depends="jar, compileTest">
<jar destfile="./build/mstreamingTest.jar" basedir="./buildTest/obj" includes="**/*.class" update="true" />
<target name="jarDemo" depends="jar, compileDemo">
<jar destfile="./build/mstreamingDemo.jar" basedir="./buildDemo/obj" includes="**/*.class" update="true" />
</target>
<target name="listChangedFiles" depends="jarUpToDate" if="shouldListChanges" >
@@ -138,9 +138,151 @@
splitindex="true"
windowtitle="I2P ministreaming library" />
</target>
<target name="builddeptest">
<ant dir="../../../core/java" target="jar" />
</target>
<target name="junit.compileTest" depends="builddeptest, compile">
<echo message="[DEBUG] ant home is ${ant.home}" />
<echo message="[DEBUG] junit home before override is ${junit.home}" />
<echo message="[DEBUG] hamcrest home before override is ${hamcrest.home}" />
<echo message="[DEBUG] mockito home before override is ${mockito.home}" />
<property name="junit.home" value="${ant.home}/lib" />
<property name="hamcrest.home" value="${ant.home}/lib" />
<property name="mockito.home" value="${ant.home}/lib" />
<echo message="[DEBUG] junit home after override is ${junit.home}" />
<echo message="[DEBUG] hamcrest home after override is ${hamcrest.home}" />
<echo message="[DEBUG] mockito home after override is ${mockito.home}" />
<javac
srcdir="./test/junit"
debug="true" deprecation="on" source="${javac.version}" target="${javac.version}"
includeAntRuntime="false"
destdir="./build/obj" >
<classpath>
<pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="${junit.home}/junit4.jar" />
<pathelement location="${hamcrest.home}/hamcrest.jar" />
<pathelement location="${hamcrest.home}/hamcrest-all.jar" />
<pathelement location="${mockito.home}/byte-buddy.jar" />
<pathelement location="${mockito.home}/objenesis.jar" />
<pathelement location="${mockito.home}/mockito-core.jar" />
</classpath>
<compilerarg line="${javac.compilerargs}" />
</javac>
</target>
<!-- preparation of code coverage tool of choice -->
<target name="prepareClover" depends="compile" if="with.clover">
<taskdef resource="clovertasks"/>
<mkdir dir="../../../reports/ministreaming/clover" />
<clover-setup initString="../../../reports/ministreaming/clover/coverage.db"/>
</target>
<target name="prepareCobertura" depends="compile" if="with.cobertura">
<taskdef classpath="${with.cobertura}" resource="tasks.properties" onerror="report" />
<mkdir dir="./build/obj_cobertura" />
<delete file="./cobertura.ser" />
<cobertura-instrument todir="./build/obj_cobertura">
<fileset dir="./build/obj">
<include name="**/*.class"/>
<!-- exclude stub classes -->
<exclude name="net/i2p/client/streaming/I2PSocketManagerFull.class" />
<!-- exclude Test classes -->
<exclude name="**/*Test.class" />
<exclude name="net/i2p/client/streaming/impl/I2PSocketManagerFull.class" />
<!-- exclude anything not in net.i2p.* -->
<exclude name="org/cybergarage/**/*.class" />
<exclude name="org/freenetproject/**/*.class" />
<exclude name="org/xlattice/**/*.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="prepareTest" depends="prepareClover, prepareCobertura" />
<target name="junit.test" depends="clean, junit.compileTest, prepareTest">
<mkdir dir="../../../reports/ministreaming/junit/" />
<delete>
<fileset dir="../../../reports/ministreaming/junit">
<include name="TEST-*.xml"/>
</fileset>
</delete>
<property name="junit.home" value="${ant.home}/lib" />
<property name="hamcrest.home" value="${ant.home}/lib" />
<property name="mockito.home" value="${ant.home}/lib" />
<junit printsummary="withOutAndErr" fork="yes" showoutput="yes" >
<sysproperty key="net.sourceforge.cobertura.datafile" file="./cobertura.ser" />
<classpath>
<pathelement path="${javac.classpath}" />
<pathelement location="${hamcrest.home}/hamcrest-core.jar" />
<pathelement location="${hamcrest.home}/hamcrest-library.jar" />
<pathelement location="${hamcrest.home}/hamcrest-integration.jar" />
<pathelement location="${hamcrest.home}/hamcrest-all.jar" />
<pathelement location="${mockito.home}/byte-buddy.jar" />
<pathelement location="${mockito.home}/objenesis.jar" />
<pathelement location="${mockito.home}/mockito-core.jar" />
<pathelement location="${junit.home}/junit4.jar" />
<pathelement location="./build/obj_cobertura" />
<pathelement location="./build/obj" />
<pathelement location="../../../core/java/build/i2ptest.jar" />
<pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="../../build/jbigi.jar" />
<pathelement location="${with.clover}" />
<pathelement location="${with.cobertura}" />
</classpath>
<batchtest todir="../../../reports/ministreaming/junit/">
<fileset dir="./test/junit">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
<!-- set if unset -->
<property name="host.fakename" value="i2ptester" />
<!-- replace hostname that junit inserts into reports with fake one -->
<replaceregexp byline="true"
match="(hostname=)&quot;[^&quot;]+&quot;"
replace="\1&quot;${host.fakename}&quot;">
<fileset dir="../../../reports/ministreaming/junit/" />
</replaceregexp>
</target>
<target name="test" depends="junit.test"/>
<!-- test reports -->
<target name="junit.report">
<junitreport todir="../../../reports/ministreaming/junit">
<fileset dir="../../../reports/ministreaming/junit">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="../../../reports/ministreaming/html/junit"/>
</junitreport>
</target>
<target name="clover.report" depends="test" if="with.clover">
<clover-report>
<current outfile="../../../reports/ministreaming/html/clover">
<format type="html"/>
</current>
</clover-report>
</target>
<target name="cobertura.report" depends="test" if="with.cobertura">
<mkdir dir="../../../reports/ministreaming/cobertura" />
<cobertura-report format="xml" srcdir="./src" destdir="../../../reports/ministreaming/cobertura" />
<mkdir dir="../../../reports/ministreaming/html/cobertura" />
<cobertura-report format="html" srcdir="./src" destdir="../../../reports/ministreaming/html/cobertura" />
<delete file="./cobertura.ser" />
</target>
<target name="test.report" depends="junit.report, clover.report, cobertura.report"/>
<!-- end test reports -->
<target name="fulltest" depends="cleandep, test, test.report" />
<!-- end unit tests -->
<target name="clean">
<delete dir="./build" />
<delete dir="./buildTest" />
<delete dir="./buildDemo" />
</target>
<target name="cleandep" depends="clean">
</target>
@@ -11,6 +11,7 @@ import java.util.Properties;
import net.i2p.I2PAppContext;
import net.i2p.I2PException;
import net.i2p.data.DataFormatException;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
import net.i2p.util.I2PThread;
import net.i2p.util.Log;
@@ -141,7 +142,7 @@ public class StreamSinkServer {
if (_log.shouldLog(Log.DEBUG))
_log.debug("read and wrote " + read + " (" + written + ")");
}
fos.write(("written: [" + written + "]\n").getBytes());
fos.write((DataHelper.getUTF8("written: [" + written + "]\n")));
long lifetime = System.currentTimeMillis() - start;
_log.info("Got EOF from client socket [written=" + written + " lifetime=" + lifetime + "]");
} catch (IOException ioe) {
@@ -1,14 +1,11 @@
package net.i2p.client.streaming.impl;
package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkSend;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/**
*
*/
public class StreamSinkTestClient {
public static void main(String args[]) {
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
//System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net");
//System.setProperty(I2PClient.PROP_TCP_PORT, "4501");
System.setProperty("tunnels.depthInbound", "0");
@@ -1,14 +1,11 @@
package net.i2p.client.streaming.impl;
package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkServer;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/**
*
*/
public class StreamSinkTestServer {
public static void main(String args[]) {
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
//System.setProperty(I2PClient.PROP_TCP_HOST, "dev.i2p.net");
//System.setProperty(I2PClient.PROP_TCP_PORT, "4101");
System.setProperty("tunnels.depthInbound", "0");
@@ -1,10 +1,8 @@
package net.i2p.client.streaming.impl;
package net.i2p.client.streaming;
import net.i2p.client.streaming.I2PSocketManagerFactory;
import net.i2p.client.streaming.StreamSinkClient;
import net.i2p.client.streaming.StreamSinkSend;
import net.i2p.client.streaming.StreamSinkServer;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
/**
* Usage: StreamSinkTest [(old|new) [#hops [#kb]]]
*/
@@ -26,30 +24,23 @@ public class StreamSinkTestStandalone {
/* */
public static void main(String args[]) {
boolean old = false;
int hops = 0;
int kb = 32*1024;
if (args.length > 0) {
if ("old".equals(args[0]))
old = true;
}
if (args.length > 1) {
try {
hops = Integer.parseInt(args[1]);
hops = Integer.parseInt(args[0]);
} catch (NumberFormatException nfe) {
hops = 0;
}
}
if (args.length > 2) {
if (args.length > 1) {
try {
kb = Integer.parseInt(args[2]);
kb = Integer.parseInt(args[1]);
} catch (NumberFormatException nfe) {
kb = 32*1024;
}
}
if (!old)
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
System.setProperty("tunnels.depthInbound", ""+hops);
new Thread(new Runnable() {
@@ -116,6 +116,8 @@ public class I2PSocketEepGet extends EepGet {
URI url = new URI(_actualURL);
if ("http".equals(url.getScheme())) {
String host = url.getHost();
if (host == null)
throw new MalformedURLException("no hostname: " + _actualURL);
int port = url.getPort();
if (port <= 0 || port > 65535)
port = 80;
@@ -0,0 +1,171 @@
package net.i2p.client.streaming;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import net.i2p.client.I2PClientFactory;
import net.i2p.data.Destination;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
public class I2PSocketAddressTest {
private static final String STATS_HOST = "stats.i2p";
private static final String STATS_DEST = "Okd5sN9hFWx-sr0HH8EFaxkeIMi6PC5eGTcjM1KB7uQ0ffCUJ2nVKzcsKZFHQc7pLONjOs2LmG5H-2SheVH504EfLZnoB7vxoamhOMENnDABkIRGGoRisc5AcJXQ759LraLRdiGSR0WTHQ0O1TU0hAz7vAv3SOaDp9OwNDr9u902qFzzTKjUTG5vMTayjTkLo2kOwi6NVchDeEj9M7mjj5ySgySbD48QpzBgcqw1R27oIoHQmjgbtbmV2sBL-2Tpyh3lRe1Vip0-K0Sf4D-Zv78MzSh8ibdxNcZACmZiVODpgMj2ejWJHxAEz41RsfBpazPV0d38Mfg4wzaS95R5hBBo6SdAM4h5vcZ5ESRiheLxJbW0vBpLRd4mNvtKOrcEtyCvtvsP3FpA-6IKVswyZpHgr3wn6ndDHiVCiLAQZws4MsIUE1nkfxKpKtAnFZtPrrB8eh7QO9CkH2JBhj7bG0ED6mV5~X5iqi52UpsZ8gnjZTgyG5pOF8RcFrk86kHxAAAA";
@BeforeClass
public static void createHostsFile() throws IOException {
String line = STATS_HOST + "=" + STATS_DEST + "\n";
FileOutputStream out = new FileOutputStream("hosts.txt");
try {
out.write(line.getBytes());
} finally {
out.close();
}
}
@AfterClass
public static void deleteHostsFiles() {
File f = new File("hosts.txt");
f.delete();
f = new File("hostsdb.blockfile");
f.delete();
}
@Test
public void testConstruct_Host() {
I2PSocketAddress addr = new I2PSocketAddress(STATS_HOST);
assertThat(addr.getPort(), is(0));
assertThat(addr.getAddress().toBase64(), is(equalTo(STATS_DEST)));
assertThat(addr.getHostName(), is(equalTo(STATS_HOST)));
assertFalse(addr.isUnresolved());
}
@Test
public void testConstruct_Host_withPort() {
I2PSocketAddress addr = new I2PSocketAddress(STATS_HOST + ":81");
assertThat(addr.getPort(), is(81));
assertThat(addr.getAddress().toBase64(), is(equalTo(STATS_DEST)));
assertThat(addr.getHostName(), is(equalTo(STATS_HOST)));
assertFalse(addr.isUnresolved());
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Host_negPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST + ":-1");
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Host_highPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST + ":90000");
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Host_missingPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST + ":");
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Host_notAPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST + ":spam");
}
@Test
public void testConstruct_Dest() {
Destination dest = new Destination();
I2PSocketAddress addr = new I2PSocketAddress(dest, 1234);
assertThat(addr.getPort(), is(1234));
assertThat(addr.getAddress(), is(dest));
assertThat(addr.getHostName(), is(nullValue()));
assertFalse(addr.isUnresolved());
}
@Test(expected=NullPointerException.class)
public void testConstruct_nullDest_throwsNPE() {
new I2PSocketAddress((Destination)null, 1234);
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Dest_negPort_throwsIAE() {
new I2PSocketAddress(new Destination(), -1);
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_Dest_highPort_throwsIAE() {
new I2PSocketAddress(new Destination(), 90000);
}
@Test
public void testConstruct_HostPort() {
I2PSocketAddress addr = new I2PSocketAddress(STATS_HOST, 81);
assertThat(addr.getPort(), is(81));
assertThat(addr.getAddress().toBase64(), is(equalTo(STATS_DEST)));
assertThat(addr.getHostName(), is(equalTo(STATS_HOST)));
assertFalse(addr.isUnresolved());
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_HostPort_negPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST, -1);
}
@Test(expected=IllegalArgumentException.class)
public void testConstruct_HostPort_highPort_throwsIAE() {
new I2PSocketAddress(STATS_HOST, 90000);
}
@Test
public void testCreateUnresolved() {
I2PSocketAddress addr = I2PSocketAddress.createUnresolved(STATS_HOST, 81);
assertThat(addr.getPort(), is(81));
assertThat(addr.getHostName(), is(STATS_HOST));
assertTrue(addr.isUnresolved());
assertThat(addr.getAddress().toBase64(), is(equalTo(STATS_DEST)));
assertFalse(addr.isUnresolved());
}
@Test(expected=IllegalArgumentException.class)
public void testCreateUnresolved_negPort_throwsIAE() {
I2PSocketAddress.createUnresolved(STATS_HOST, -1);
}
@Test(expected=IllegalArgumentException.class)
public void testCreateUnresolved_highPort_throwsIAE() {
I2PSocketAddress.createUnresolved(STATS_HOST, 90000);
}
@Test
public void testToString() throws Exception {
Destination dest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream());
I2PSocketAddress addr = new I2PSocketAddress(dest, 1234);
assertThat(addr.toString(), is(equalTo(dest.calculateHash().toString() + ":1234")));
}
@Test
public void testToString_unresolved() {
I2PSocketAddress addr = I2PSocketAddress.createUnresolved("example.i2p", 1234);
assertThat(addr.toString(), is(equalTo("example.i2p:1234")));
}
@Test
public void testEquals() {
I2PSocketAddress addr = I2PSocketAddress.createUnresolved("example.i2p", 1234);
assertTrue(addr.equals(I2PSocketAddress.createUnresolved("example.i2p", 1234)));
assertFalse(addr.equals(I2PSocketAddress.createUnresolved("example2.i2p", 1234)));
assertFalse(addr.equals(I2PSocketAddress.createUnresolved("example.i2p", 1235)));
assertFalse(addr.equals(I2PSocketAddress.createUnresolved("example.i2p", 1235)));
Destination dest = new Destination();
I2PSocketAddress addr2 = new I2PSocketAddress(dest, 1234);
assertFalse(addr.equals(null));
assertFalse(addr.equals(dest));
assertFalse(addr.equals(addr2));
assertFalse(addr2.equals(addr));
}
}
@@ -0,0 +1,144 @@
package net.i2p.client.streaming;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;
import net.i2p.I2PAppContext;
import net.i2p.data.Destination;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
public class I2PSocketEepGetTest {
private static final String STATS_HOST = "stats.i2p";
private static final String STATS_DEST = "Okd5sN9hFWx-sr0HH8EFaxkeIMi6PC5eGTcjM1KB7uQ0ffCUJ2nVKzcsKZFHQc7pLONjOs2LmG5H-2SheVH504EfLZnoB7vxoamhOMENnDABkIRGGoRisc5AcJXQ759LraLRdiGSR0WTHQ0O1TU0hAz7vAv3SOaDp9OwNDr9u902qFzzTKjUTG5vMTayjTkLo2kOwi6NVchDeEj9M7mjj5ySgySbD48QpzBgcqw1R27oIoHQmjgbtbmV2sBL-2Tpyh3lRe1Vip0-K0Sf4D-Zv78MzSh8ibdxNcZACmZiVODpgMj2ejWJHxAEz41RsfBpazPV0d38Mfg4wzaS95R5hBBo6SdAM4h5vcZ5ESRiheLxJbW0vBpLRd4mNvtKOrcEtyCvtvsP3FpA-6IKVswyZpHgr3wn6ndDHiVCiLAQZws4MsIUE1nkfxKpKtAnFZtPrrB8eh7QO9CkH2JBhj7bG0ED6mV5~X5iqi52UpsZ8gnjZTgyG5pOF8RcFrk86kHxAAAA";
private static final String FETCH_URL = "http://" + STATS_HOST;
private static final String FETCH_B64 = "http://i2p/" + STATS_DEST + "/";
private static final String FETCH_BAD_B64 = "http://i2p/" + STATS_DEST;
private static final String FETCH_RESULT_HEADER = "HTTP/1.1 200 OK\n" +
"Date: Sun, 26 Jul 2015 00:00:00 GMT\n" +
"Content-Length: 50\n" +
"Last-Modified: Wed, 01 Jul 2015 13:37:00 GMT\n" +
"Connection: close\n" +
"Content-Type: text/html\n" +
"Accept-Ranges: bytes\n" +
"Cache-Control: max-age=3600,public\n" +
"Proxy-Connection: close\n\n";
private static final String FETCH_RESULT = "<html><head><title>stats.i2p</title></head></html>";
@Rule
public MockitoRule rule = MockitoJUnit.rule();
@Mock private I2PSocketManager mgr;
@Mock private I2PSocketOptions opts;
@Mock private I2PSocket sock;
@BeforeClass
public static void createHostsFile() throws IOException {
String line = STATS_HOST + "=" + STATS_DEST + "\n";
FileOutputStream out = new FileOutputStream("hosts.txt");
try {
out.write(line.getBytes());
} finally {
out.close();
}
}
@AfterClass
public static void deleteHostsFiles() {
File f = new File("hosts.txt");
f.delete();
f = new File("hostsdb.blockfile");
f.delete();
}
@Before
public void setupMocks() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayInputStream in = new ByteArrayInputStream((FETCH_RESULT_HEADER + FETCH_RESULT).getBytes());
when(mgr.buildOptions((Properties) any())).thenReturn(opts);
when(mgr.connect((Destination) any(), eq(opts))).thenReturn(sock);
when(sock.getOutputStream()).thenReturn(out);
when(sock.getInputStream()).thenReturn(in);
}
public void fetchFrom(String url, boolean shouldSucceed) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
I2PSocketEepGet eep = new I2PSocketEepGet(I2PAppContext.getGlobalContext(),
mgr, 0, -1, -1, null, baos, url);
if (shouldSucceed) {
assertTrue(eep.fetch());
assertThat(baos.toString(), is(equalTo(FETCH_RESULT)));
} else {
assertFalse(eep.fetch());
assertThat(baos.toString().length(), is(0));
}
}
@Test
public void testFetch() {
fetchFrom(FETCH_URL, true);
}
@Test
public void testFetch_withQuery() {
fetchFrom(FETCH_URL + "?foo=bar", true);
}
@Test
public void testFetch_malformedUrl() {
fetchFrom(STATS_HOST, false);
}
@Test
public void testFetch_unsupportedProto() {
fetchFrom("https://" + STATS_HOST, false);
}
@Test
public void testFetch_port() {
fetchFrom("http://" + STATS_HOST + ":81", true);
}
@Test
public void testFetch_negPort() {
// Gets rewritten to 80
fetchFrom("http://" + STATS_HOST + ":-1", true);
}
@Test
public void testFetch_highPort() {
// Gets rewritten to 80
fetchFrom("http://" + STATS_HOST + ":90000", true);
}
@Test
public void testFetch_B64() {
fetchFrom(FETCH_B64, true);
}
@Test
public void testFetch_badB64() {
fetchFrom(FETCH_BAD_B64, false);
}
@Test
public void testFetch_fakeUrl() {
fetchFrom("http://example.i2p", false);
}
}
@@ -0,0 +1,65 @@
package net.i2p.client.streaming;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.util.HashMap;
import java.util.Map;
import net.i2p.client.SendMessageStatusListener;
import net.i2p.data.i2cp.MessageStatusMessage;
import org.junit.Test;
public class I2PSocketExceptionTest {
private static Map<Integer, String> statusMap;
static {
Map<Integer, String> map = new HashMap<Integer, String>();
map.put(MessageStatusMessage.STATUS_SEND_BEST_EFFORT_FAILURE, "Message timeout");
map.put(MessageStatusMessage.STATUS_SEND_GUARANTEED_FAILURE, "Message timeout");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_LOCAL, "Failed delivery to local destination");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_ROUTER, "Local router failure");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_NETWORK, "Local network failure");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_BAD_SESSION, "Session closed");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_BAD_MESSAGE, "Invalid message");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_BAD_OPTIONS, "Invalid message options");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_OVERFLOW, "Buffer overflow");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_EXPIRED, "Message expired");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_LOCAL_LEASESET, "Local lease set invalid");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_NO_TUNNELS, "No local tunnels");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_UNSUPPORTED_ENCRYPTION, "Unsupported encryption options");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_DESTINATION, "Invalid destination");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_BAD_LEASESET, "Local router failure");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_EXPIRED_LEASESET, "Destination lease set expired");
map.put(MessageStatusMessage.STATUS_SEND_FAILURE_NO_LEASESET, "Destination lease set not found");
map.put(SendMessageStatusListener.STATUS_CANCELLED, "Local destination shutdown");
map.put(I2PSocketException.STATUS_CONNECTION_RESET, "Connection was reset");
statusMap = map;
}
@Test
public void testKnownStatus() {
for (Map.Entry<Integer, String> entry : statusMap.entrySet()) {
int status = entry.getKey();
String msg = entry.getValue();
I2PSocketException e = new I2PSocketException(status);
assertThat(e.getStatus(), is(status));
assertThat(e.getMessage(), is(msg));
}
}
@Test
public void testCustomStatus() {
I2PSocketException e = new I2PSocketException("foo");
assertThat(e.getStatus(), is(-1));
assertThat(e.getMessage(), is("foo"));
}
@Test
public void testUnknownStatus() {
I2PSocketException e = new I2PSocketException(255);
assertThat(e.getStatus(), is(255));
assertThat(e.getMessage(), is("Failure code: 255"));
}
}
@@ -0,0 +1,68 @@
package net.i2p.client.streaming;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Properties;
import net.i2p.client.I2PClient;
import net.i2p.client.I2PClientFactory;
import net.i2p.client.streaming.impl.I2PSocketManagerFull;
import net.i2p.data.Destination;
import org.junit.Test;
public class I2PSocketManagerFactoryTest {
@Test
public void testCreateDiscMgr() throws Exception {
I2PSocketManagerFull mgr = (I2PSocketManagerFull) I2PSocketManagerFactory.createDisconnectedManager(null, null, 0, null);
assertThat(mgr, is(not(nullValue())));
assertThat(mgr.getName(), is("manager"));
assertTrue(mgr.getOpts().containsKey(I2PClient.PROP_RELIABILITY));
assertThat(mgr.getOpts().getProperty(I2PClient.PROP_RELIABILITY), is(I2PClient.PROP_RELIABILITY_NONE));
}
@Test
public void testCreateDiscMgr_customDest() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Destination dest = I2PClientFactory.createClient().createDestination(baos);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
I2PSocketManagerFull mgr = (I2PSocketManagerFull) I2PSocketManagerFactory.createDisconnectedManager(bais, null, 0, null);
assertThat(mgr, is(not(nullValue())));
assertThat(mgr.getName(), is("manager"));
assertThat(mgr.getSession().getMyDestination(), is(equalTo(dest)));
}
@Test
public void testCreateDiscMgr_customI2CP() throws Exception {
I2PSocketManagerFull mgr = (I2PSocketManagerFull) I2PSocketManagerFactory.createDisconnectedManager(null, "example.com", 3333, null);
assertThat(mgr, is(not(nullValue())));
assertThat(mgr.getName(), is("manager"));
assertTrue(mgr.getOpts().containsKey(I2PClient.PROP_TCP_HOST));
assertThat(mgr.getOpts().getProperty(I2PClient.PROP_TCP_HOST), is("example.com"));
assertTrue(mgr.getOpts().containsKey(I2PClient.PROP_TCP_PORT));
assertThat(mgr.getOpts().getProperty(I2PClient.PROP_TCP_PORT), is("3333"));
}
@Test
public void testCreateDiscMgr_customOpts() throws Exception {
Properties opts = new Properties();
opts.setProperty(I2PClient.PROP_RELIABILITY, I2PClient.PROP_RELIABILITY_BEST_EFFORT);
opts.setProperty("foo", "bar");
I2PSocketManagerFull mgr = (I2PSocketManagerFull) I2PSocketManagerFactory.createDisconnectedManager(null, null, 0, opts);
assertThat(mgr, is(not(nullValue())));
assertThat(mgr.getName(), is("manager"));
assertTrue(mgr.getOpts().containsKey(I2PClient.PROP_RELIABILITY));
assertThat(mgr.getOpts().getProperty(I2PClient.PROP_RELIABILITY), is(I2PClient.PROP_RELIABILITY_BEST_EFFORT));
assertTrue(mgr.getOpts().containsKey("foo"));
assertThat(mgr.getOpts().getProperty("foo"), is("bar"));
}
}
@@ -0,0 +1,196 @@
package net.i2p.client.streaming.impl;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.net.ConnectException;
import java.net.NoRouteToHostException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import net.i2p.I2PAppContext;
import net.i2p.I2PException;
import net.i2p.client.I2PSession;
import net.i2p.client.I2PSessionException;
import net.i2p.client.streaming.I2PServerSocket;
import net.i2p.client.streaming.I2PSocket;
import net.i2p.client.streaming.I2PSocketManager;
import net.i2p.client.streaming.I2PSocketOptions;
import net.i2p.data.Destination;
/**
* Stub for testing I2PSocketManagerFactory.
*
* @author str4d
*/
public class I2PSocketManagerFull implements I2PSocketManager {
private I2PSession _session;
private Properties _opts;
private String _name;
/**
* This is what I2PSocketManagerFactory.createManager() returns.
* Direct instantiation by others is deprecated.
*
* @param context non-null
* @param session non-null
* @param opts may be null
* @param name non-null
*/
public I2PSocketManagerFull(I2PAppContext context, I2PSession session, Properties opts, String name) {
_session = session;
_opts = opts;
_name = name;
}
@Override
public I2PSession getSession() {
return _session;
}
public Properties getOpts() {
return _opts;
}
@Override
public String getName() {
return _name;
}
@Override
public I2PSession addSubsession(InputStream privateKeyStream,
Properties opts) throws I2PSessionException {
throw new UnsupportedOperationException();
}
@Override
public void removeSubsession(I2PSession session) {
throw new UnsupportedOperationException();
}
@Override
public List<I2PSession> getSubsessions() {
throw new UnsupportedOperationException();
}
@Override
public void setAcceptTimeout(long ms) {
throw new UnsupportedOperationException();
}
@Override
public long getAcceptTimeout() {
throw new UnsupportedOperationException();
}
@Override
public void setDefaultOptions(I2PSocketOptions options) {
throw new UnsupportedOperationException();
}
@Override
public I2PSocketOptions getDefaultOptions() {
throw new UnsupportedOperationException();
}
@Override
public I2PServerSocket getServerSocket() {
throw new UnsupportedOperationException();
}
@Override
public I2PSocketOptions buildOptions() {
throw new UnsupportedOperationException();
}
@Override
public I2PSocketOptions buildOptions(Properties opts) {
throw new UnsupportedOperationException();
}
@Override
public I2PSocket connect(Destination peer, I2PSocketOptions options)
throws I2PException, ConnectException, NoRouteToHostException,
InterruptedIOException {
throw new UnsupportedOperationException();
}
@Override
public I2PSocket connect(Destination peer) throws I2PException,
ConnectException, NoRouteToHostException, InterruptedIOException {
throw new UnsupportedOperationException();
}
@Override
public void destroySocketManager() {
throw new UnsupportedOperationException();
}
@Override
public boolean isDestroyed() {
throw new UnsupportedOperationException();
}
@Override
public Set<I2PSocket> listSockets() {
throw new UnsupportedOperationException();
}
@Override
public boolean ping(Destination peer, long timeoutMs) {
throw new UnsupportedOperationException();
}
@Override
public boolean ping(Destination peer, int localPort, int remotePort,
long timeoutMs) {
throw new UnsupportedOperationException();
}
@Override
public byte[] ping(Destination peer, int localPort, int remotePort,
long timeoutMs, byte[] payload) {
throw new UnsupportedOperationException();
}
@Override
public void setName(String name) {
throw new UnsupportedOperationException();
}
@Override
public void init(I2PAppContext context, I2PSession session,
Properties opts, String name) {
throw new UnsupportedOperationException();
}
@Override
public void addDisconnectListener(DisconnectListener lsnr) {
throw new UnsupportedOperationException();
}
@Override
public void removeDisconnectListener(DisconnectListener lsnr) {
throw new UnsupportedOperationException();
}
@Override
public ServerSocket getStandardServerSocket() throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Socket connectToSocket(Destination peer) throws IOException {
throw new UnsupportedOperationException();
}
@Override
public Socket connectToSocket(Destination peer, int timeout)
throws IOException {
throw new UnsupportedOperationException();
}
}
@@ -19,6 +19,7 @@ import static net.i2p.app.ClientAppState.*;
import net.i2p.data.DataHelper;
import net.i2p.util.FileUtil;
import net.i2p.util.Log;
import net.i2p.util.SystemVersion;
import net.i2p.util.TranslateReader;
import org.cybergarage.xml.Node;
@@ -233,7 +234,7 @@ public class NewsManager implements ClientApp {
// Doesn't work if the date has a : in it, but SHORT hopefully does not
DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
fmt.setTimeZone(DataHelper.getSystemTimeZone(_context));
fmt.setTimeZone(SystemVersion.getSystemTimeZone(_context));
try {
Date date = fmt.parse(newsContent.substring(0, colon));
entry.updated = date.getTime();
@@ -43,6 +43,7 @@ import net.i2p.util.PortMapper;
import net.i2p.util.ReusableGZIPInputStream;
import net.i2p.util.SecureFileOutputStream;
import net.i2p.util.SSLEepGet;
import net.i2p.util.SystemVersion;
import net.i2p.util.Translate;
import net.i2p.util.VersionComparator;
@@ -589,7 +590,7 @@ class NewsFetcher extends UpdateRunner {
return;
DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
fmt.setTimeZone(DataHelper.getSystemTimeZone(_context));
fmt.setTimeZone(SystemVersion.getSystemTimeZone(_context));
for (NewsEntry e : entries) {
if (e.title == null || e.content == null)
continue;
@@ -101,7 +101,7 @@ public class BanlistRenderer {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -3,7 +3,9 @@ package net.i2p.router.web;
import java.io.File;
import java.io.IOException;
import net.i2p.data.DataHelper;
import net.i2p.util.FileUtil;
import net.i2p.router.crypto.FamilyKeyCrypto;
/**
@@ -49,7 +51,23 @@ public class CertHelper extends HelperBase {
}
if (!hasTunnels)
output(_t("I2PTunnel"), null);
_out.write("<h3>");
_out.write(_t("Local Router Family Certificate"));
_out.write("</h3>\n");
String family = _context.getProperty(FamilyKeyCrypto.PROP_FAMILY_NAME);
if (family != null) {
File f = new File(dir, "family");
f = new File(f, family + ".crt");
output(_t("Family") + ": " + DataHelper.escapeHTML(family), f);
} else {
_out.write("<p>");
_out.write(_t("none"));
_out.write("</p>\n");
}
// anything else? plugins?
} catch (IOException ioe) {
ioe.printStackTrace();
}
@@ -61,8 +79,8 @@ public class CertHelper extends HelperBase {
*/
private void output(String name, File file) throws IOException {
_out.write("<p><h4>");
_out.write("</h4>");
_out.write(name);
_out.write("</h4>");
if (file != null && file.exists()) {
String cert = FileUtil.readTextFile(file.toString(), -1, true);
if (cert != null) {
@@ -73,9 +91,9 @@ public class CertHelper extends HelperBase {
_out.write(": read failure");
}
} else {
_out.write(": ");
_out.write("<p>");
_out.write(_t("none"));
_out.write("</p>\n");
}
_out.write("</p>\n");
}
}
@@ -55,7 +55,7 @@ public class ConfigAdvancedHandler extends FormHandler {
if (_config != null) {
Properties props = new Properties();
try {
DataHelper.loadProps(props, new ByteArrayInputStream(_config.getBytes()));
DataHelper.loadProps(props, new ByteArrayInputStream(DataHelper.getUTF8(_config)));
} catch (IOException ioe) {
_log.error("Config error", ioe);
addFormError(ioe.toString());
@@ -6,7 +6,6 @@ import java.util.TreeMap;
import net.i2p.data.DataHelper;
public class ConfigAdvancedHelper extends HelperBase {
private final static String CHECKED = " checked=\"checked\" ";
static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant";
public String getSettings() {
@@ -244,7 +244,7 @@ public class ConfigClientsHandler extends FormHandler {
// edit of an existing entry
if (_context.getBooleanProperty(ConfigClientsHelper.PROP_ENABLE_CLIENT_CHANGE) ||
isAdvanced()) {
String desc = getJettyString("desc" + cur);
String desc = getJettyString("nofilter_desc" + cur);
if (desc != null) {
int spc = desc.indexOf(" ");
String clss = desc;
@@ -255,7 +255,7 @@ public class ConfigClientsHandler extends FormHandler {
}
ca.className = clss;
ca.args = args;
ca.clientName = getJettyString("name" + cur);
ca.clientName = getJettyString("nofilter_name" + cur);
}
}
}
@@ -264,7 +264,7 @@ public class ConfigClientsHandler extends FormHandler {
if (_context.getBooleanProperty(ConfigClientsHelper.PROP_ENABLE_CLIENT_CHANGE) ||
isAdvanced()) {
int newClient = clients.size();
String newDesc = getJettyString("desc" + newClient);
String newDesc = getJettyString("nofilter_desc" + newClient);
if (newDesc != null && newDesc.trim().length() > 0) {
// new entry
int spc = newDesc.indexOf(" ");
@@ -274,10 +274,10 @@ public class ConfigClientsHandler extends FormHandler {
clss = newDesc.substring(0, spc);
args = newDesc.substring(spc + 1);
}
String name = getJettyString("name" + newClient);
String name = getJettyString("nofilter_name" + newClient);
if (name == null || name.trim().length() <= 0) name = "new client";
ClientAppConfig ca = new ClientAppConfig(clss, name, args, 2*60*1000,
_settings.get(newClient + ".enabled") != null);
_settings.get(newClient + ".enabled") == null); // true for disabled
clients.add(ca);
addFormNotice(_t("New client added") + ": " + name + " (" + clss + ").");
}
@@ -64,7 +64,7 @@ public class ConfigClientsHelper extends HelperBase {
if ((mode == 0 && disabled) ||
(mode == 1 && (!disabled) && (!ssl)) ||
(mode == 2 && (!disabled) && ssl))
return "checked=\"checked\"";
return CHECKED;
return "";
}
@@ -72,7 +72,7 @@ public class ConfigClientsHelper extends HelperBase {
public String getAuth() {
boolean enabled = _context.getBooleanProperty(PROP_AUTH);
if (enabled)
return "checked=\"checked\"";
return CHECKED;
return "";
}
@@ -151,7 +151,7 @@ public class ConfigClientsHelper extends HelperBase {
//"webConsole".equals(ca.clientName) || "Web console".equals(ca.clientName),
false, RouterConsoleRunner.class.getName().equals(ca.className),
// description
ca.className + ((ca.args != null) ? " " + ca.args : ""),
DataHelper.escapeHTML(ca.className + ((ca.args != null) ? " " + ca.args : "")),
// edit
allowEdit && (""+cur).equals(_edit),
// show edit button, show update button
@@ -212,7 +212,7 @@ public class ConfigClientsHelper extends HelperBase {
boolean isRunning = WebAppStarter.isWebAppRunning(app);
renderForm(buf, app, app, !"addressbook".equals(app),
"true".equals(val), RouterConsoleRunner.ROUTERCONSOLE.equals(app),
RouterConsoleRunner.ROUTERCONSOLE.equals(app), app + ".war",
RouterConsoleRunner.ROUTERCONSOLE.equals(app), DataHelper.escapeHTML(app + ".war"),
false, false, false, isRunning, false, !isRunning);
}
}
@@ -316,31 +316,33 @@ public class ConfigClientsHelper extends HelperBase {
/**
* Misnamed, renders a single line in a table for a single client/webapp/plugin.
*
* ro trumps edit and showEditButton
* @param name will be escaped here
* @param ro trumps edit and showEditButton
* @param escapedDesc description, must be HTML escaped, except for plugins
*/
private void renderForm(StringBuilder buf, String index, String name, boolean urlify,
boolean enabled, boolean ro, boolean preventDisable, String desc, boolean edit,
boolean enabled, boolean ro, boolean preventDisable, String escapedDesc, boolean edit,
boolean showEditButton, boolean showUpdateButton, boolean showStopButton,
boolean showDeleteButton, boolean showStartButton) {
String escapeddesc = DataHelper.escapeHTML(desc);
String escapedName = DataHelper.escapeHTML(name);
buf.append("<tr><td class=\"mediumtags\" align=\"right\" width=\"25%\">");
if (urlify && enabled) {
String link = "/";
if (! RouterConsoleRunner.ROUTERCONSOLE.equals(name))
link += name + "/";
buf.append("<a href=\"").append(link).append("\">").append(_t(name)).append("</a>");
link += escapedName + "/";
buf.append("<a href=\"").append(link).append("\">").append(_t(escapedName)).append("</a>");
} else if (edit && !ro) {
buf.append("<input type=\"text\" name=\"name").append(index).append("\" value=\"");
buf.append("<input type=\"text\" name=\"nofilter_name").append(index).append("\" value=\"");
if (name.length() > 0)
buf.append(_t(name));
buf.append(_t(escapedName));
buf.append("\" >");
} else {
if (name.length() > 0)
buf.append(_t(name));
buf.append(_t(escapedName));
}
buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\"");
if (enabled) {
buf.append("checked=\"checked\" ");
buf.append(CHECKED);
if (ro || preventDisable)
buf.append("disabled=\"disabled\" ");
}
@@ -366,17 +368,17 @@ public class ConfigClientsHelper extends HelperBase {
if (showDeleteButton && (!edit) && !ro) {
buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index)
.append("\" onclick=\"if (!confirm('")
.append(_t("Are you sure you want to delete {0}?", _t(name)))
.append(_t("Are you sure you want to delete {0}?", _t(escapedName)))
.append("')) { return false; }\">")
.append(_t("Delete")).append("<span class=hide> ").append(index).append("</span></button>");
}
buf.append("</td><td align=\"left\" width=\"50%\">");
if (edit && !ro) {
buf.append("<input type=\"text\" size=\"80\" spellcheck=\"false\" name=\"desc").append(index).append("\" value=\"");
buf.append(escapeddesc);
buf.append("<input type=\"text\" size=\"80\" spellcheck=\"false\" name=\"nofilter_desc").append(index).append("\" value=\"");
buf.append(escapedDesc);
buf.append("\" >");
} else {
buf.append(desc);
buf.append(escapedDesc);
}
buf.append("</td></tr>\n");
}
@@ -4,6 +4,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.Properties;
import net.i2p.data.DataHelper;
import net.i2p.util.LogManager;
/**
@@ -76,7 +77,7 @@ public class ConfigLoggingHandler extends FormHandler {
try {
Properties props = new Properties();
if (_levels != null)
props.load(new ByteArrayInputStream(_levels.getBytes()));
props.load(new ByteArrayInputStream(DataHelper.getUTF8(_levels)));
if (_newLogClass != null)
props.setProperty(_newLogClass, _newLogLevel);
_context.logManager().setLimits(props);
@@ -25,7 +25,6 @@ public class ConfigNetHelper extends HelperBase {
final static String PROP_I2NP_NTCP_PORT = "i2np.ntcp.port";
final static String PROP_I2NP_NTCP_AUTO_PORT = "i2np.ntcp.autoport";
final static String PROP_I2NP_NTCP_AUTO_IP = "i2np.ntcp.autoip";
private final static String CHECKED = " checked=\"checked\" ";
public String getUdphostname() {
return _context.getProperty(UDPTransport.PROP_EXTERNAL_HOST, "");
@@ -78,13 +77,6 @@ public class ConfigNetHelper extends HelperBase {
return _context.getProperty(UDPTransport.PROP_INTERNAL_PORT, "unset");
}
/** @param prop must default to false */
public String getChecked(String prop) {
if (_context.getBooleanProperty(prop))
return CHECKED;
return "";
}
public String getDynamicKeysChecked() {
return getChecked(Router.PROP_DYNAMIC_KEYS);
}
@@ -42,12 +42,12 @@ public class ConfigPeerHandler extends FormHandler {
PeerProfile prof = _context.profileOrganizer().getProfile(h);
if (prof != null) {
try {
prof.setSpeedBonus(Long.parseLong(_speed));
prof.setSpeedBonus(Integer.parseInt(_speed));
} catch (NumberFormatException nfe) {
addFormError(_t("Bad speed value"));
}
try {
prof.setCapacityBonus(Long.parseLong(_capacity));
prof.setCapacityBonus(Integer.parseInt(_capacity));
} catch (NumberFormatException nfe) {
addFormError(_t("Bad capacity value"));
}
@@ -56,34 +56,26 @@ public class ConfigReseedHelper extends HelperBase {
if ((mode == 0 && (!disabled) && (!required)) ||
(mode == 1 && (!disabled) && required) ||
(mode == 2 && disabled))
return "checked=\"checked\"";
return CHECKED;
return "";
}
public String getEnable() {
return checked(Reseeder.PROP_PROXY_ENABLE);
return getChecked(Reseeder.PROP_PROXY_ENABLE);
}
/** @since 0.8.9 */
public String getAuth() {
return checked(Reseeder.PROP_PROXY_AUTH_ENABLE);
return getChecked(Reseeder.PROP_PROXY_AUTH_ENABLE);
}
public String getSenable() {
return checked(Reseeder.PROP_SPROXY_ENABLE);
return getChecked(Reseeder.PROP_SPROXY_ENABLE);
}
/** @since 0.8.9 */
public String getSauth() {
return checked(Reseeder.PROP_SPROXY_AUTH_ENABLE);
}
/** @since 0.8.9 */
private String checked(String prop) {
boolean enabled = _context.getBooleanProperty(prop);
if (enabled)
return "checked=\"checked\"";
return "";
return getChecked(Reseeder.PROP_SPROXY_AUTH_ENABLE);
}
public String getReseedURL() {
@@ -155,13 +155,12 @@ public class ConfigServiceHandler extends FormHandler {
/**
* Register a handler for signals,
* so we can handle HUP from the wrapper (non-Windows only, wrapper 3.2.0 or higher)
* so we can handle HUP from the wrapper (wrapper 3.2.0 or higher)
*
* @since 0.8.13
*/
synchronized static void registerSignalHandler(RouterContext ctx) {
if (ctx.hasWrapper() && _wrapperListener == null &&
!SystemVersion.isWindows()) {
if (ctx.hasWrapper() && _wrapperListener == null) {
String wv = System.getProperty("wrapper.version");
if (wv != null && VersionComparator.comp(wv, LISTENER_AVAILABLE) >= 0) {
try {
@@ -14,13 +14,13 @@ public class ConfigUIHelper extends HelperBase {
for (String theme : themes) {
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
if (theme.equals(current))
buf.append("checked=\"checked\" ");
buf.append(CHECKED);
buf.append("value=\"").append(theme).append("\">").append(_t(theme)).append("<br>\n");
}
boolean universalTheming = _context.getBooleanProperty(CSSHelper.PROP_UNIVERSAL_THEMING);
buf.append("<input type=\"checkbox\" name=\"universalTheming\" ");
if (universalTheming)
buf.append("checked=\"checked\" ");
buf.append(CHECKED);
buf.append("value=\"1\">")
.append(_t("Set theme universally across all apps"))
.append("<br>\n");
@@ -32,7 +32,7 @@ public class ConfigUIHelper extends HelperBase {
boolean forceMobileConsole = _context.getBooleanProperty(CSSHelper.PROP_FORCE_MOBILE_CONSOLE);
buf.append("<input type=\"checkbox\" name=\"forceMobileConsole\" ");
if (forceMobileConsole)
buf.append("checked=\"checked\" ");
buf.append(CHECKED);
buf.append("value=\"1\">")
.append(_t("Force the mobile console to be used"))
.append("<br>\n");
@@ -99,7 +99,8 @@ public class ConfigUIHelper extends HelperBase {
{ "tr", "tr", _x("Turkish"), null },
{ "uk", "ua", _x("Ukrainian"), null },
{ "vi", "vn", _x("Vietnamese"), null },
{ "zh", "cn", _x("Chinese"), null }
{ "zh", "cn", _x("Chinese"), null },
{ "zh_TW", "tw", _x("Chinese"), "Taiwan" }
};
@@ -138,7 +139,7 @@ public class ConfigUIHelper extends HelperBase {
buf.append("<input type=\"radio\" class=\"optbox\" name=\"lang\" ");
String lang = langs[i][0];
if (lang.equals(current))
buf.append("checked=\"checked\" ");
buf.append(CHECKED);
buf.append("value=\"").append(lang).append("\">")
.append("<img height=\"11\" width=\"16\" alt=\"\" src=\"/flags.jsp?c=").append(langs[i][1]).append("\"> ");
int under = lang.indexOf('_');
@@ -88,8 +88,8 @@ public class ConfigUpdateHandler extends FormHandler {
"http://stats.i2p/i2p/i2pupdate.su2\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.su2\r\n" +
"http://update.dg.i2p/files/i2pupdate.su2\r\n" +
"http://update.killyourtv.i2p/i2pupdate.su2\r\n" +
"http://update.postman.i2p/i2pupdate.su2" ;
"http://update.killyourtv.i2p/i2pupdate.su2\r\n" ;
// "http://update.postman.i2p/i2pupdate.su2" ;
private static final String NO_PACK200_URLS =
"http://echelon.i2p/i2p/i2pupdate.sud\r\n" +
@@ -98,8 +98,8 @@ public class ConfigUpdateHandler extends FormHandler {
"http://stats.i2p/i2p/i2pupdate.sud\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.sud\r\n" +
"http://update.dg.i2p/files/i2pupdate.sud\r\n" +
"http://update.killyourtv.i2p/i2pupdate.sud\r\n" +
"http://update.postman.i2p/i2pupdate.sud" ;
"http://update.killyourtv.i2p/i2pupdate.sud\r\n" ;
// "http://update.postman.i2p/i2pupdate.sud" ;
/**
* These are only for .sud and .su2.
@@ -132,8 +132,8 @@ public class ConfigUpdateHandler extends FormHandler {
"http://stats.i2p/i2p/i2pupdate.su3\r\n" +
// "http://www.i2p2.i2p/_static/i2pupdate.su3\r\n" +
"http://update.dg.i2p/files/i2pupdate.su3\r\n" +
"http://update.killyourtv.i2p/i2pupdate.su3\r\n" +
"http://update.postman.i2p/i2pupdate.su3" ;
"http://update.killyourtv.i2p/i2pupdate.su3\r\n" ;
// "http://update.postman.i2p/i2pupdate.su3" ;
/**
* Empty string if disabled. Cannot be overridden by config.
@@ -90,18 +90,14 @@ public class ConfigUpdateHelper extends HelperBase {
}
public String getUpdateUnsigned() {
if (_context.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED))
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateUnsigned\" checked=\"checked\" >";
else
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateUnsigned\" >";
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateUnsigned\" " +
getChecked(ConfigUpdateHandler.PROP_UPDATE_UNSIGNED) + '>';
}
/** @since 0.9.20 */
public String getUpdateDevSU3() {
if (_context.getBooleanProperty(ConfigUpdateHandler.PROP_UPDATE_DEV_SU3))
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateDevSU3\" checked=\"checked\" >";
else
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateDevSU3\" >";
return "<input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"updateDevSU3\" " +
getChecked(ConfigUpdateHandler.PROP_UPDATE_DEV_SU3) + '>';
}
private static final long PERIODS[] = new long[] { 12*60*60*1000l, 24*60*60*1000l,
@@ -16,6 +16,7 @@ import java.util.TreeMap;
import net.i2p.data.DataHelper;
import net.i2p.router.util.EventLog;
import net.i2p.util.SystemVersion;
/**
* /events.jsp
@@ -188,7 +189,7 @@ public class EventLogHelper extends FormHandler {
SimpleDateFormat fmt = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
fmt.setTimeZone(DataHelper.getSystemTimeZone(_context));
fmt.setTimeZone(SystemVersion.getSystemTimeZone(_context));
List<Map.Entry<Long, String>> entries = new ArrayList<Map.Entry<Long, String>>(events.entrySet());
Collections.reverse(entries);
@@ -305,7 +305,7 @@ public abstract class FormHandler {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -358,8 +358,8 @@ public class GraphHelper extends FormHandler {
"<input type=\"hidden\" name=\"action\" value=\"save\">\n" +
"<input type=\"hidden\" name=\"nonce\" value=\"" + nonce + "\" >\n");
_out.write(_t("Periods") + ": <input size=\"5\" style=\"text-align: right;\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\"><br>\n");
_out.write(_t("Plot averages") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"checked\" ") + "> ");
_out.write(_t("or")+ " " +_t("plot events") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"checked\" " : "") + "><br>\n");
_out.write(_t("Plot averages") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : HelperBase.CHECKED) + "> ");
_out.write(_t("or")+ " " +_t("plot events") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? HelperBase.CHECKED : "") + "><br>\n");
_out.write(_t("Image sizes") + ": " + _t("width") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"width\" value=\"" + _width
+ "\"> " + _t("pixels") + ", " + _t("height") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"height\" value=\"" + _height
+ "\"> " + _t("pixels") + "<br>\n");
@@ -382,7 +382,7 @@ public class GraphHelper extends FormHandler {
" <input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"persistent\"");
boolean persistent = _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT);
if (persistent)
_out.write(" checked=\"checked\"");
_out.write(HelperBase.CHECKED);
_out.write(">" +
"<hr><div class=\"formaction\"><input type=\"submit\" class=\"accept\" value=\"" + _t("Save settings and redraw graphs") + "\"></div></form>");
} catch (IOException ioe) {
@@ -12,6 +12,7 @@ public abstract class HelperBase {
protected Writer _out;
static final String PROP_ADVANCED = "routerconsole.advanced";
static final String CHECKED = " checked=\"checked\" ";
/**
* Configure this bean to query a particular router context
@@ -43,6 +44,19 @@ public abstract class HelperBase {
*/
public void storeWriter(Writer out) { _out = out; }
/**
* Is a boolean property set to true?
*
* @param prop must default to false
* @return non-null, either "" or " checked=\"checked\" "
* @since 0.9.24 consolidated from various helpers
*/
protected String getChecked(String prop) {
if (_context.getBooleanProperty(prop))
return CHECKED;
return "";
}
/** translate a string */
public String _t(String s) {
return Messages.getString(s, _context);
@@ -56,7 +70,7 @@ public abstract class HelperBase {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -103,8 +103,7 @@ public class HomeHelper extends HelperBase {
}
public String getConfigHome() {
boolean oldHome = _context.getBooleanProperty(PROP_OLDHOME);
return oldHome ? "checked=\"true\"" : "";
return getChecked(PROP_OLDHOME);
}
public String getProxyStatus() {
@@ -24,7 +24,7 @@ public class Messages extends Translate {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -19,7 +19,8 @@ public class NetDbHelper extends HelperBase {
_x("All Routers"), // 3
_x("All Routers with Full Stats"), // 4
"LeaseSet Debug", // 5
_x("LeaseSets") }; // 6
_x("LeaseSets"), // 6
"Sybil" }; // 7
private static final String links[] =
{"", // 0
@@ -28,7 +29,8 @@ public class NetDbHelper extends HelperBase {
"?f=2", // 3
"?f=1", // 4
"?l=2", // 5
"?l=1" }; // 6
"?l=1", // 6
"?f=3" }; // 7
public void setRouter(String r) {
if (r != null)
@@ -77,6 +79,8 @@ public class NetDbHelper extends HelperBase {
renderer.renderRouterInfoHTML(_out, _routerPrefix, _version, _country);
else if (_lease)
renderer.renderLeaseSetHTML(_out, _debug);
else if (_full == 3)
(new SybilRenderer(_context)).getNetDbSummary(_out);
else
renderer.renderStatusHTML(_out, _full);
} catch (IOException ioe) {
@@ -101,6 +105,8 @@ public class NetDbHelper extends HelperBase {
return 3;
if (_full == 1)
return 4;
if (_full == 3)
return 7;
return 0;
}
@@ -119,7 +125,7 @@ public class NetDbHelper extends HelperBase {
for (int i = 0; i < titles.length; i++) {
if (i == 2 && tab != 2)
continue; // can't nav to lookup
if (i == 5 && !_context.getBooleanProperty(PROP_ADVANCED))
if ((i == 5 || i == 7) && !_context.getBooleanProperty(PROP_ADVANCED))
continue;
if (i == tab) {
// we are there
@@ -40,7 +40,7 @@ import net.i2p.util.ObjectCounter;
import net.i2p.util.Translate;
import net.i2p.util.VersionComparator;
public class NetDbRenderer {
class NetDbRenderer {
private final RouterContext _context;
public NetDbRenderer (RouterContext ctx) {
@@ -69,7 +69,7 @@ public class NetDbRenderer {
_us = us;
}
public int compare(LeaseSet l, LeaseSet r) {
return HashDistance.getDistance(_us, l.getRoutingKey()).subtract(HashDistance.getDistance(_us, r.getRoutingKey())).signum();
return HashDistance.getDistance(_us, l.getRoutingKey()).compareTo(HashDistance.getDistance(_us, r.getRoutingKey()));
}
}
@@ -266,7 +266,7 @@ public class NetDbRenderer {
* http://forums.sun.com/thread.jspa?threadID=597652
* @since 0.7.14
*/
private static double biLog2(BigInteger a) {
public static double biLog2(BigInteger a) {
int b = a.bitLength() - 1;
double c = 0;
double d = 0.5;
@@ -555,7 +555,7 @@ public class NetDbRenderer {
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _t("foo {0} bar", _t("baz"))
* To translate parameter also, use _t("foo {0} bar", _t("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
@@ -10,6 +10,7 @@ import net.i2p.app.ClientAppManager;
import net.i2p.data.DataHelper;
import net.i2p.router.news.NewsEntry;
import net.i2p.router.news.NewsManager;
import net.i2p.util.SystemVersion;
/**
@@ -55,7 +56,7 @@ public class NewsFeedHelper extends HelperBase {
if (!entries.isEmpty()) {
DateFormat fmt = DateFormat.getDateInstance(DateFormat.SHORT);
// the router sets the JVM time zone to UTC but saves the original here so we can get it
fmt.setTimeZone(DataHelper.getSystemTimeZone(ctx));
fmt.setTimeZone(SystemVersion.getSystemTimeZone(ctx));
int i = 0;
for (NewsEntry entry : entries) {
if (i++ < start)
@@ -47,7 +47,9 @@ class ProfileOrganizerRenderer {
int standard = 0;
for (Hash peer : peers) {
if (_organizer.getUs().equals(peer)) continue;
PeerProfile prof = _organizer.getProfile(peer);
PeerProfile prof = _organizer.getProfileNonblocking(peer);
if (prof == null)
continue;
if (mode == 2) {
RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer);
if (info != null && info.getCapabilities().indexOf("f") >= 0)
@@ -364,6 +366,9 @@ class ProfileOrganizerRenderer {
private String formatInterval(long now, long then) {
if (then <= 0)
return _t(NA);
// avoid 0 or negative
if (now <= then)
return DataHelper.formatDuration2(1);
return DataHelper.formatDuration2(now - then);
}

Some files were not shown because too many files have changed in this diff Show More