");
@@ -653,9 +653,9 @@ public class TransientSessionKeyManager extends SessionKeyManager {
* Just for the HTML method above so we can see what's going on easier
* Earliest first
*/
- private static class TagSetComparator implements Comparator {
- public int compare(Object l, Object r) {
- return (int) (((TagSet)l).getDate() - ((TagSet)r).getDate());
+ private static class TagSetComparator implements Comparator {
+ public int compare(TagSet l, TagSet r) {
+ return (int) (l.getDate() - r.getDate());
}
}
diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java
index 5cfaad8ef..fb86c5eaa 100644
--- a/core/java/src/net/i2p/data/DataHelper.java
+++ b/core/java/src/net/i2p/data/DataHelper.java
@@ -55,16 +55,8 @@ import net.i2p.util.Translate;
* @author jrandom
*/
public class DataHelper {
- private static final byte EQUAL_BYTES[];
- private static final byte SEMICOLON_BYTES[];
- static {
- try {
- EQUAL_BYTES = "=".getBytes("UTF-8");
- SEMICOLON_BYTES = ";".getBytes("UTF-8");
- } catch (UnsupportedEncodingException uee) {
- throw new RuntimeException("no utf8!?");
- }
- }
+ private static final byte[] EQUAL_BYTES = getUTF8("=");
+ private static final byte[] SEMICOLON_BYTES = getUTF8(";");
/** Read a mapping from the stream, as defined by the I2P data structure spec,
* and store it into a Properties object.
diff --git a/core/java/src/net/i2p/data/RoutingKeyGenerator.java b/core/java/src/net/i2p/data/RoutingKeyGenerator.java
index f4c62dba9..fc4ed2764 100644
--- a/core/java/src/net/i2p/data/RoutingKeyGenerator.java
+++ b/core/java/src/net/i2p/data/RoutingKeyGenerator.java
@@ -40,13 +40,14 @@ import net.i2p.util.RandomSource;
*
*/
public class RoutingKeyGenerator {
- private Log _log;
- private I2PAppContext _context;
+ private final Log _log;
+ private final I2PAppContext _context;
public RoutingKeyGenerator(I2PAppContext context) {
_log = context.logManager().getLog(RoutingKeyGenerator.class);
_context = context;
}
+
public static RoutingKeyGenerator getInstance() {
return I2PAppContext.getGlobalContext().routingKeyGenerator();
}
diff --git a/core/java/src/net/i2p/time/NtpMessage.java b/core/java/src/net/i2p/time/NtpMessage.java
index 5db2d1390..96546382d 100644
--- a/core/java/src/net/i2p/time/NtpMessage.java
+++ b/core/java/src/net/i2p/time/NtpMessage.java
@@ -33,6 +33,7 @@ import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
+import net.i2p.util.RandomSource;
/**
* This class represents a NTP message, as specified in RFC 2030. The message
@@ -399,7 +400,7 @@ public class NtpMessage {
// low order bits of the timestamp with a random, unbiased
// bitstring, both to avoid systematic roundoff errors and as
// a means of loop detection and replay detection.
- array[7+pointer] = (byte) (Math.random()*255.0);
+ array[7+pointer] = (byte) (RandomSource.getInstance().nextInt());
}
diff --git a/core/java/src/net/i2p/time/Timestamper.java b/core/java/src/net/i2p/time/Timestamper.java
index 0167c102d..addec7f74 100644
--- a/core/java/src/net/i2p/time/Timestamper.java
+++ b/core/java/src/net/i2p/time/Timestamper.java
@@ -321,14 +321,16 @@ public class Timestamper implements Runnable {
_context.getProperty(PROP_CONCURRING_SERVERS, DEFAULT_CONCURRING_SERVERS)));
}
+/****
public static void main(String args[]) {
System.setProperty(PROP_DISABLED, "false");
System.setProperty(PROP_QUERY_FREQUENCY, "30000");
- I2PAppContext ctx = I2PAppContext.getGlobalContext();
+ I2PAppContext.getGlobalContext();
for (int i = 0; i < 5*60*1000; i += 61*1000) {
try { Thread.sleep(61*1000); } catch (InterruptedException ie) {}
}
}
+****/
/**
* Interface to receive update notifications for when we query the time
diff --git a/core/java/src/net/metanotion/io/block/BlockFile.java b/core/java/src/net/metanotion/io/block/BlockFile.java
index 96a76d5bd..b8019e0a3 100644
--- a/core/java/src/net/metanotion/io/block/BlockFile.java
+++ b/core/java/src/net/metanotion/io/block/BlockFile.java
@@ -443,7 +443,7 @@ public class BlockFile {
public BSkipList makeIndex(String name, Serializer key, Serializer val) throws IOException {
if(metaIndex.get(name) != null) { throw new IOException("Index already exists"); }
int page = allocPage();
- metaIndex.put(name, new Integer(page));
+ metaIndex.put(name, Integer.valueOf(page));
BSkipList.init(this, page, spanSize);
BSkipList bsl = new BSkipList(spanSize, this, page, key, val, true);
openIndices.put(name, bsl);
diff --git a/debian/patches/0002-jbigi-soname.patch b/debian/patches/0002-jbigi-soname.patch
index a361317fd..71a54faba 100644
--- a/debian/patches/0002-jbigi-soname.patch
+++ b/debian/patches/0002-jbigi-soname.patch
@@ -12,7 +12,7 @@ a soname to shut lintian up.
--- a/core/c/jbigi/mbuild_jbigi.sh
+++ b/core/c/jbigi/mbuild_jbigi.sh
-@@ -47,7 +47,7 @@
+@@ -48,7 +48,7 @@
fi
fi
COMPILEFLAGS="-fPIC -Wall"
@@ -21,7 +21,7 @@ a soname to shut lintian up.
LINKFLAGS="-shared -Wl,-soname,libjbigi.so"
LIBFILE="libjbigi.so";;
*)
-@@ -66,7 +66,7 @@
+@@ -67,7 +67,7 @@
echo "Compiling C code..."
rm -f jbigi.o $LIBFILE
diff --git a/debian/patches/0003-renaming-jcpuid.patch b/debian/patches/0003-renaming-jcpuid.patch
index 9053c14c9..0b5250a4c 100644
--- a/debian/patches/0003-renaming-jcpuid.patch
+++ b/debian/patches/0003-renaming-jcpuid.patch
@@ -8,23 +8,14 @@ Subject: rename jcpuid
--- a/core/c/jcpuid/build.sh
+++ b/core/c/jcpuid/build.sh
-@@ -37,7 +37,7 @@
- COMPILEFLAGS="-Wall"
- INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/solaris/"
- LINKFLAGS="-shared -static -Wl,-soname,libjcpuid-x86-solaris.so"
-- LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-solaris.so";;
-+ LIBFILE="lib/freenet/support/CPUInformation/libjcpuid.so";;
- FreeBSD*)
- COMPILEFLAGS="-Wall"
- INCLUDES="-I. -Iinclude -I$JAVA_HOME/include/ -I$JAVA_HOME/include/freebsd/"
-@@ -46,8 +46,8 @@
- *kFreeBSD*|Linux*)
- COMPILEFLAGS="-fPIC -Wall"
- INCLUDES="-I. -Iinclude -I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
-- LINKFLAGS="-shared -Wl,-soname,libjcpuid-x86-linux.so"
-- LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so";;
-+ LINKFLAGS="-shared -Wl,-soname,libjcpuid.so"
-+ LIBFILE="../jbigi/libjcpuid.so";;
+@@ -83,8 +83,8 @@
+ echo "and/or set JAVA_HOME then re-run this script."
+ exit 1
+ fi
+- LINKFLAGS="-shared -Wl,-soname,libjcpuid-${ARCH}-${UNIXTYPE}.so"
+- LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-${ARCH}-${UNIXTYPE}.so"
++ LINKFLAGS="-shared -Wl,-soname,libjcpuid.so"
++ LIBFILE="../jbigi/libjcpuid.so"
+ COMPILEFLAGS="-fPIC -Wall"
+ INCLUDES="-I. -Iinclude -I${JAVA_HOME}/include -I${JAVA_HOME}/include/${UNIXTYPE}";;
esac
-
- echo "Compiling C code..."
diff --git a/history.txt b/history.txt
index e6d0eb685..de2fb2c50 100644
--- a/history.txt
+++ b/history.txt
@@ -1,3 +1,29 @@
+2011-09-30 kytv
+ * fix umask bug by upgrading to wrapper v3.5.12. Binaries are from Tanuki's
+ delta pack for the community edition, except:
+ - Win64: not available from Tanuki--compiled with VS2010
+ - FreeBSD: Tanuki's binaries are compiled in FBSD v6. I compiled the
+ wrapper in FreeBSD 7.4 to eliminate the dependency on the compat6x port.
+ - Linux ARM: not available from Tanuki
+ - OSX: Tanuki offers separate binaries for 32bit VS 64bit. Our
+ wrapper is quad-fat supporting PPC32/PPC64 and x86/x86_64.
+
+2011-09-29 zzz
+ * Bandwidth refiller: Reinitialize at restart, avoid
+ issues from clock skews
+
+2011-09-27 kytv
+ * Remove exotrack.i2p from i2psnark
+
+2011-09-24 zzz
+ * HTTPClient: Fix error page not appearing, broken by
+ StreamForwarder change
+ * HTTPServer: More mime types not to compress
+
+2011-09-23 kytv
+ * Update Italian, Spanish, and Swedish translations
+ from Transifex
+
2011-09-20 zzz
* Crypto: Comment out some main()
* ClientMessage: Remove unused MessageReceptionInfo
diff --git a/installer/lib/wrapper/all/wrapper.jar b/installer/lib/wrapper/all/wrapper.jar
index fa77ea930..e233fcff9 100644
Binary files a/installer/lib/wrapper/all/wrapper.jar and b/installer/lib/wrapper/all/wrapper.jar differ
diff --git a/installer/lib/wrapper/freebsd/i2psvc b/installer/lib/wrapper/freebsd/i2psvc
index efb7dcb83..8aa27cc9b 100644
Binary files a/installer/lib/wrapper/freebsd/i2psvc and b/installer/lib/wrapper/freebsd/i2psvc differ
diff --git a/installer/lib/wrapper/freebsd/libwrapper.so b/installer/lib/wrapper/freebsd/libwrapper.so
index 0922eeb8e..528dd726e 100644
Binary files a/installer/lib/wrapper/freebsd/libwrapper.so and b/installer/lib/wrapper/freebsd/libwrapper.so differ
diff --git a/installer/lib/wrapper/freebsd64/i2psvc b/installer/lib/wrapper/freebsd64/i2psvc
index 977a9c84a..e7d67a09e 100755
Binary files a/installer/lib/wrapper/freebsd64/i2psvc and b/installer/lib/wrapper/freebsd64/i2psvc differ
diff --git a/installer/lib/wrapper/freebsd64/libwrapper.so b/installer/lib/wrapper/freebsd64/libwrapper.so
index 1a1581e28..251632be6 100755
Binary files a/installer/lib/wrapper/freebsd64/libwrapper.so and b/installer/lib/wrapper/freebsd64/libwrapper.so differ
diff --git a/installer/lib/wrapper/linux-armv5/i2psvc b/installer/lib/wrapper/linux-armv5/i2psvc
index b0a930c95..6329b0a45 100644
Binary files a/installer/lib/wrapper/linux-armv5/i2psvc and b/installer/lib/wrapper/linux-armv5/i2psvc differ
diff --git a/installer/lib/wrapper/linux-armv5/libwrapper.so b/installer/lib/wrapper/linux-armv5/libwrapper.so
index 45e47f590..fd507afd7 100644
Binary files a/installer/lib/wrapper/linux-armv5/libwrapper.so and b/installer/lib/wrapper/linux-armv5/libwrapper.so differ
diff --git a/installer/lib/wrapper/linux-ppc/i2psvc b/installer/lib/wrapper/linux-ppc/i2psvc
index 7ab423429..42af66d97 100755
Binary files a/installer/lib/wrapper/linux-ppc/i2psvc and b/installer/lib/wrapper/linux-ppc/i2psvc differ
diff --git a/installer/lib/wrapper/linux-ppc/libwrapper.so b/installer/lib/wrapper/linux-ppc/libwrapper.so
index 59c3a25fb..12c753f98 100644
Binary files a/installer/lib/wrapper/linux-ppc/libwrapper.so and b/installer/lib/wrapper/linux-ppc/libwrapper.so differ
diff --git a/installer/lib/wrapper/linux/i2psvc b/installer/lib/wrapper/linux/i2psvc
index 7bfaa0e36..e729a67b2 100644
Binary files a/installer/lib/wrapper/linux/i2psvc and b/installer/lib/wrapper/linux/i2psvc differ
diff --git a/installer/lib/wrapper/linux/libwrapper.so b/installer/lib/wrapper/linux/libwrapper.so
index 47c4b7fef..a67f60c2e 100644
Binary files a/installer/lib/wrapper/linux/libwrapper.so and b/installer/lib/wrapper/linux/libwrapper.so differ
diff --git a/installer/lib/wrapper/linux64/i2psvc b/installer/lib/wrapper/linux64/i2psvc
index a72f2f509..885c601ef 100644
Binary files a/installer/lib/wrapper/linux64/i2psvc and b/installer/lib/wrapper/linux64/i2psvc differ
diff --git a/installer/lib/wrapper/linux64/libwrapper.so b/installer/lib/wrapper/linux64/libwrapper.so
index 331c37665..9ab884fd8 100644
Binary files a/installer/lib/wrapper/linux64/libwrapper.so and b/installer/lib/wrapper/linux64/libwrapper.so differ
diff --git a/installer/lib/wrapper/macosx/i2psvc b/installer/lib/wrapper/macosx/i2psvc
index ba98eb315..baefc2858 100644
Binary files a/installer/lib/wrapper/macosx/i2psvc and b/installer/lib/wrapper/macosx/i2psvc differ
diff --git a/installer/lib/wrapper/macosx/libwrapper.jnilib b/installer/lib/wrapper/macosx/libwrapper.jnilib
index 1ee47ce27..f111c0922 100644
Binary files a/installer/lib/wrapper/macosx/libwrapper.jnilib and b/installer/lib/wrapper/macosx/libwrapper.jnilib differ
diff --git a/installer/lib/wrapper/solaris/i2psvc b/installer/lib/wrapper/solaris/i2psvc
index d6edd393d..503c094bd 100644
Binary files a/installer/lib/wrapper/solaris/i2psvc and b/installer/lib/wrapper/solaris/i2psvc differ
diff --git a/installer/lib/wrapper/solaris/libwrapper.so b/installer/lib/wrapper/solaris/libwrapper.so
index f63c88e83..2c710d084 100644
Binary files a/installer/lib/wrapper/solaris/libwrapper.so and b/installer/lib/wrapper/solaris/libwrapper.so differ
diff --git a/installer/lib/wrapper/win32/I2Psvc.exe b/installer/lib/wrapper/win32/I2Psvc.exe
index e6a0096a8..207d69c37 100644
Binary files a/installer/lib/wrapper/win32/I2Psvc.exe and b/installer/lib/wrapper/win32/I2Psvc.exe differ
diff --git a/installer/lib/wrapper/win32/wrapper.dll b/installer/lib/wrapper/win32/wrapper.dll
index d1418f4af..7d597a501 100644
Binary files a/installer/lib/wrapper/win32/wrapper.dll and b/installer/lib/wrapper/win32/wrapper.dll differ
diff --git a/installer/lib/wrapper/win64/I2Psvc.exe b/installer/lib/wrapper/win64/I2Psvc.exe
index 6d6b61035..4357dc29d 100755
Binary files a/installer/lib/wrapper/win64/I2Psvc.exe and b/installer/lib/wrapper/win64/I2Psvc.exe differ
diff --git a/installer/lib/wrapper/win64/README-x64-win.txt b/installer/lib/wrapper/win64/README-x64-win.txt
index e7f3279dc..086e57d67 100644
--- a/installer/lib/wrapper/win64/README-x64-win.txt
+++ b/installer/lib/wrapper/win64/README-x64-win.txt
@@ -1,5 +1,5 @@
-Changes will probably be needed for newer versions than 3.5.9.
-
-To use the patch in this directory, copy Makefile-windows-x86-32.nmake to
-Makefile-windows-x86-64.nmake then "patch < x64-win.patch". Compiles cleanly
-using VS2010.
+Changes will probably be needed for newer versions than 3.5.12.
+
+To use the patch in this directory, copy Makefile-windows-x86-32.nmake to
+Makefile-windows-x86-64.nmake then "patch < x64-win.patch". Compiles cleanly
+using VS2010.
diff --git a/installer/lib/wrapper/win64/wrapper.dll b/installer/lib/wrapper/win64/wrapper.dll
index 9f27992fa..31577c94e 100644
Binary files a/installer/lib/wrapper/win64/wrapper.dll and b/installer/lib/wrapper/win64/wrapper.dll differ
diff --git a/installer/lib/wrapper/win64/x64-win.patch b/installer/lib/wrapper/win64/x64-win.patch
index 4679c6cd5..0ceac6ea4 100644
--- a/installer/lib/wrapper/win64/x64-win.patch
+++ b/installer/lib/wrapper/win64/x64-win.patch
@@ -1,5 +1,5 @@
---- Makefile-windows-x86-64.nmake 2011-05-28 21:12:05.383721860 +0000
-+++ Makefile-windows-x86-64.nmake 2011-06-09 19:43:59.349132461 +0000
+--- Makefile-windows-x86-32.nmake 2011-09-29 20:34:25.447939000 +0000
++++ Makefile-windows-x86-64.nmake 2011-09-29 20:51:57.297170000 +0000
@@ -9,19 +9,19 @@
PROJ = wrapper
@@ -14,7 +14,7 @@
-EXE_OUTDIR = $(PROJ)32_VC8__Win32_Release
+EXE_OUTDIR = $(PROJ)32_VC8__Win64_Release
EXE_OBJS = $(EXE_OUTDIR)\wrapper_i18n.obj $(EXE_OUTDIR)\logger.obj $(EXE_OUTDIR)\property.obj $(EXE_OUTDIR)\wrapper.obj $(EXE_OUTDIR)\wrapper_win.obj $(EXE_OUTDIR)\wrappereventloop.obj $(EXE_OUTDIR)\wrapper_file.obj $(EXE_OUTDIR)\wrapperinfo.obj
- EXE_LIBS = mpr.lib shell32.lib wsock32.lib shlwapi.lib advapi32.lib user32.lib Crypt32.lib Wintrust.lib pdh.lib
+ EXE_LIBS = mpr.lib shell32.lib netapi32.lib wsock32.lib shlwapi.lib advapi32.lib user32.lib Crypt32.lib Wintrust.lib pdh.lib
EXE_COMPILE_OPTS = /O2 /GL /D "_CONSOLE"
EXE_LINK_OPTS = /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTFILE:"$(EXE_OUTDIR)\$(PROJ).exe.intermediate.manifest" /PDB:"$(EXE_OUTDIR)\$(PROJ).pdb" /OPT:REF /OPT:ICF /LTCG
diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter
index 4b2d4abf4..c11d8f1d3 100644
--- a/installer/resources/i2prouter
+++ b/installer/resources/i2prouter
@@ -149,21 +149,9 @@ failed() {
case `uname -s` in
FreeBSD)
echo
- echo "In an attempt to ensure that I2P will run on as many systems"
- echo "as possible, included in the installation package is a"
- echo "version of the wrapper that was compiled for FreeBSD 6."
- echo "Necessary compatibility libraries may not be on your"
- echo "system. These libraries are included in the misc/compat6x port."
- echo
- echo "Additionally, the wrapper requires libiconv to be on your system."
+ echo "The wrapper requires libiconv to be on your system."
echo "It can be installed with pkg_add -r libiconv"
echo
- echo "If you cannot (or choose not to) install these libraries,"
- echo "I2P may be started with the 'runplain.sh' script. Another"
- echo "option would be to compile the java wrapper for your system."
- echo "Hints to accomplish this can be found at"
- echo "${WRAPPER_URL}."
- echo
exit 1
;;
*)
diff --git a/installer/resources/initialNews/initialNews_sv.xml b/installer/resources/initialNews/initialNews_sv.xml
new file mode 100644
index 000000000..6c272d3ce
--- /dev/null
+++ b/installer/resources/initialNews/initialNews_sv.xml
@@ -0,0 +1,20 @@
+
+ Congratulations on getting I2P installed!
+
+Välkommen till I2P!
+Ha tålamod medan I2P startar upp och letar upp peers.
+
+
+Medan du väntar, var god ställ in dina bandbreddd och port inställningar på
+konfigurations-sidan.
+
+
+När du har en "delade klienter" distination listad på vänster sida,
+ kika på vår
+FAQ.
+
+
+Rikta din IRC-klient till localhost:6668 och säg hej till oss på
+#i2p-help eller #i2p.
+
+
diff --git a/installer/resources/readme/readme_ru.html b/installer/resources/readme/readme_ru.html
index c402caa2b..407cc0676 100644
--- a/installer/resources/readme/readme_ru.html
+++ b/installer/resources/readme/readme_ru.html
@@ -26,7 +26,7 @@
Анонимный шифрованный веб-хостинг в I2P
-- Готовы к действию!
I2P идёт со встроенным готовым к работе веб-сервром для хостинга вашего собственного анонимного веб-сайта (eepsite) в сети I2P: Jetty развёрнут и слушает на http://127.0.0.1:7658/. Для размещения собственного контента,
+ - Готовы к действию!
I2P идёт со встроенным готовым к работе веб-сервером для хостинга вашего собственного анонимного веб-сайта (eepsite) в сети I2P: Jetty развёрнут и слушает на http://127.0.0.1:7658/. Для размещения собственного контента,
просто положите ваши файлы в каталог eepsite/docroot/ (или положите любой
обычный JSP/Servlet .war файл в eepsite/webapps,
или обычный CGI-скрипт внутрь eepsite/cgi-bin) и они будут показы вам.
diff --git a/router/java/src/net/i2p/router/JobImpl.java b/router/java/src/net/i2p/router/JobImpl.java
index b3a63773c..82674d922 100644
--- a/router/java/src/net/i2p/router/JobImpl.java
+++ b/router/java/src/net/i2p/router/JobImpl.java
@@ -62,6 +62,10 @@ public abstract class JobImpl implements Job {
public void madeReady() { _madeReadyOn = _context.clock().now(); }
public void dropped() {}
+ /**
+ * Warning - only call this from runJob() or if Job is not already queued,
+ * or else it gets the job queue out of order.
+ */
protected void requeue(long delayMs) {
getTiming().setStartAfter(_context.clock().now() + delayMs);
_context.jobQueue().addJob(this);
diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java
index 586a11f83..043f527bc 100644
--- a/router/java/src/net/i2p/router/Router.java
+++ b/router/java/src/net/i2p/router/Router.java
@@ -1311,6 +1311,7 @@ public class Router implements RouterClock.ClockShiftListener {
// NOTE: DisconnectMessageHandler keys off "restart"
try { _context.clientManager().shutdown("Router restart"); } catch (Throwable t) { _log.log(Log.CRIT, "Error stopping the client manager", t); }
_log.logAlways(Log.WARN, "Stopping the comm system");
+ _context.bandwidthLimiter().reinitialize();
try { _context.messageRegistry().restart(); } catch (Throwable t) { _log.log(Log.CRIT, "Error restarting the message registry", t); }
try { _context.commSystem().restart(); } catch (Throwable t) { _log.log(Log.CRIT, "Error restarting the comm system", t); }
_log.logAlways(Log.WARN, "Stopping the tunnel manager");
diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java
index f5c926454..9535f12e9 100644
--- a/router/java/src/net/i2p/router/RouterVersion.java
+++ b/router/java/src/net/i2p/router/RouterVersion.java
@@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
- public final static long BUILD = 20;
+ public final static long BUILD = 23;
/** for example "-test" */
- public final static String EXTRA = "";
+ public final static String EXTRA = "-rc";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);
diff --git a/router/java/src/net/i2p/router/TunnelInfo.java b/router/java/src/net/i2p/router/TunnelInfo.java
index 8303c3fbb..678963068 100644
--- a/router/java/src/net/i2p/router/TunnelInfo.java
+++ b/router/java/src/net/i2p/router/TunnelInfo.java
@@ -34,6 +34,27 @@ public interface TunnelInfo {
/** retrieve the peer at the given hop. the gateway is hop 0 */
public Hash getPeer(int hop);
+ /**
+ * For convenience
+ * @return getPeer(0)
+ * @since 0.8.9
+ */
+ public Hash getGateway();
+
+ /**
+ * For convenience
+ * @return getPeer(getLength() - 1)
+ * @since 0.8.9
+ */
+ public Hash getEndpoint();
+
+ /**
+ * For convenience
+ * @return isInbound() ? getGateway() : getEndpoint()
+ * @since 0.8.9
+ */
+ public Hash getFarEnd();
+
/** is this an inbound tunnel? */
public boolean isInbound();
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
index 9ff0dca8e..85815e11d 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java
@@ -103,7 +103,7 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade {
protected final static long DONT_FAIL_PERIOD = 10*60*1000;
/** don't probe or broadcast data, just respond and search when explicitly needed */
- private final boolean QUIET = false;
+ private static final boolean QUIET = false;
public static final String PROP_ENFORCE_NETID = "router.networkDatabase.enforceNetId";
private static final boolean DEFAULT_ENFORCE_NETID = false;
diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/XORComparator.java b/router/java/src/net/i2p/router/networkdb/kademlia/XORComparator.java
index 797448dbf..bfd897f0a 100644
--- a/router/java/src/net/i2p/router/networkdb/kademlia/XORComparator.java
+++ b/router/java/src/net/i2p/router/networkdb/kademlia/XORComparator.java
@@ -10,20 +10,18 @@ import net.i2p.data.Hash;
*
*/
class XORComparator implements Comparator {
- private final Hash _base;
+ private final byte[] _base;
/**
* @param target key to compare distances with
*/
public XORComparator(Hash target) {
- _base = target;
+ _base = target.getData();
}
public int compare(Hash lhs, Hash rhs) {
- if (lhs == null) throw new NullPointerException("LHS is null");
- if (rhs == null) throw new NullPointerException("RHS is null");
- byte lhsDelta[] = DataHelper.xor(lhs.getData(), _base.getData());
- byte rhsDelta[] = DataHelper.xor(rhs.getData(), _base.getData());
+ byte lhsDelta[] = DataHelper.xor(lhs.getData(), _base);
+ byte rhsDelta[] = DataHelper.xor(rhs.getData(), _base);
return DataHelper.compareTo(lhsDelta, rhsDelta);
}
}
diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
index b8f8a9590..f5aed1edc 100644
--- a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
+++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
@@ -253,6 +253,7 @@ public class FIFOBandwidthLimiter {
// it changes out from under us
// This never had locks before concurrent, anyway
+ // FIXME wrap - change to AtomicLong or detect
int avi = _availableInbound.addAndGet((int) bytesInbound);
if (avi > _maxInbound) {
if (_log.shouldLog(Log.DEBUG))
diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java
index 7dd9d4128..d01374a54 100644
--- a/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java
+++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthRefiller.java
@@ -110,6 +110,9 @@ public class FIFOBandwidthRefiller implements Runnable {
+ " rate in="
+ _inboundKBytesPerSecond + ", out="
+ _outboundKBytesPerSecond +")");
+ // clock skew
+ if (numMs >= REPLENISH_FREQUENCY * 50 || numMs <= 0)
+ numMs = REPLENISH_FREQUENCY;
if (numMs >= REPLENISH_FREQUENCY) {
long inboundToAdd = (1024*_inboundKBytesPerSecond * numMs)/1000;
long outboundToAdd = (1024*_outboundKBytesPerSecond * numMs)/1000;
diff --git a/router/java/src/net/i2p/router/tunnel/HopConfig.java b/router/java/src/net/i2p/router/tunnel/HopConfig.java
index f02a8be8e..042829fdf 100644
--- a/router/java/src/net/i2p/router/tunnel/HopConfig.java
+++ b/router/java/src/net/i2p/router/tunnel/HopConfig.java
@@ -26,10 +26,12 @@ public class HopConfig {
private long _creation;
private long _expiration;
private Map _options;
- private long _messagesProcessed;
- private long _oldMessagesProcessed;
- private long _messagesSent;
- private long _oldMessagesSent;
+ // these 4 were longs, let's save some space
+ // 2 billion * 1KB / 10 minutes = 3 GBps in a single tunnel
+ private int _messagesProcessed;
+ private int _oldMessagesProcessed;
+ private int _messagesSent;
+ private int _oldMessagesSent;
/** IV length for {@link #getReplyIV} */
public static final int REPLY_IV_LENGTH = 16;
@@ -110,16 +112,21 @@ public class HopConfig {
/** take note of a message being pumped through this tunnel */
/** "processed" is for incoming and "sent" is for outgoing (could be dropped in between) */
public void incrementProcessedMessages() { _messagesProcessed++; }
- public long getProcessedMessagesCount() { return _messagesProcessed; }
- public long getRecentMessagesCount() {
- long rv = _messagesProcessed - _oldMessagesProcessed;
+
+ public int getProcessedMessagesCount() { return _messagesProcessed; }
+
+ public int getRecentMessagesCount() {
+ int rv = _messagesProcessed - _oldMessagesProcessed;
_oldMessagesProcessed = _messagesProcessed;
return rv;
}
+
public void incrementSentMessages() { _messagesSent++; }
- public long getSentMessagesCount() { return _messagesSent; }
- public long getRecentSentMessagesCount() {
- long rv = _messagesSent - _oldMessagesSent;
+
+ public int getSentMessagesCount() { return _messagesSent; }
+
+ public int getRecentSentMessagesCount() {
+ int rv = _messagesSent - _oldMessagesSent;
_oldMessagesSent = _messagesSent;
return rv;
}
diff --git a/router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java b/router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java
index 497e8ddcd..b6d1be741 100644
--- a/router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java
+++ b/router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java
@@ -81,6 +81,33 @@ public class TunnelCreatorConfig implements TunnelInfo {
public Hash getPeer(int hop) { return _peers[hop]; }
public void setPeer(int hop, Hash peer) { _peers[hop] = peer; }
+ /**
+ * For convenience
+ * @return getPeer(0)
+ * @since 0.8.9
+ */
+ public Hash getGateway() {
+ return _peers[0];
+ }
+
+ /**
+ * For convenience
+ * @return getPeer(getLength() - 1)
+ * @since 0.8.9
+ */
+ public Hash getEndpoint() {
+ return _peers[_peers.length - 1];
+ }
+
+ /**
+ * For convenience
+ * @return isInbound() ? getGateway() : getEndpoint()
+ * @since 0.8.9
+ */
+ public Hash getFarEnd() {
+ return _peers[_isInbound ? 0 : _peers.length - 1];
+ }
+
/** is this an inbound tunnel? */
public boolean isInbound() { return _isInbound; }
|