From 20c77e15299e884a6130fbaaccdfe1d1e98894e7 Mon Sep 17 00:00:00 2001 From: zzz Date: Mon, 22 Aug 2011 19:09:09 +0000 Subject: [PATCH] fixes after review --- .../java/src/net/i2p/addressbook/Daemon.java | 2 +- .../src/net/i2p/router/web/SummaryHelper.java | 8 +-- .../src/net/i2p/util/LogConsoleBuffer.java | 4 +- history.txt | 5 ++ installer/resources/fix_logfile_path.cmd | 66 +++++++++---------- installer/resources/postinstall.sh | 1 + .../resources/release_checklist.txt | 0 7 files changed, 46 insertions(+), 40 deletions(-) rename release_checklist.txt => installer/resources/release_checklist.txt (100%) diff --git a/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java b/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java index becfc8ea43..4ce2e4f714 100644 --- a/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java +++ b/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java @@ -201,7 +201,7 @@ public class Daemon { } } catch (DataFormatException dfe) { if (log != null) - log.append("Invalid b64 for" + key + " From: " + sub.getLocation()); + log.append("Invalid b64 for " + key + " From: " + sub.getLocation()); invalid++; } total++; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 233f4167bd..0617bb7986 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -515,11 +515,11 @@ public class SummaryHelper extends HelperBase { */ public String getJobLag() { if (_context == null) - return "0 ms"; + return "0"; RateStat rs = _context.statManager().getRate("jobQueue.jobLag"); if (rs == null) - return "0 ms"; + return "0"; Rate lagRate = rs.getRate(60*1000); return DataHelper.formatDuration2((long)lagRate.getAverageValue()); } @@ -531,7 +531,7 @@ public class SummaryHelper extends HelperBase { */ public String getMessageDelay() { if (_context == null) - return "0 ms"; + return "0"; return DataHelper.formatDuration2(_context.throttle().getMessageDelay()); } @@ -543,7 +543,7 @@ public class SummaryHelper extends HelperBase { */ public String getTunnelLag() { if (_context == null) - return "0 ms"; + return "0"; return DataHelper.formatDuration2(_context.throttle().getTunnelLag()); } diff --git a/core/java/src/net/i2p/util/LogConsoleBuffer.java b/core/java/src/net/i2p/util/LogConsoleBuffer.java index 051ffbf5b7..6149c24da9 100644 --- a/core/java/src/net/i2p/util/LogConsoleBuffer.java +++ b/core/java/src/net/i2p/util/LogConsoleBuffer.java @@ -36,8 +36,8 @@ public class LogConsoleBuffer { lim = Math.max(limit, 4); // Add some extra room to minimize the chance of losing a message, // since we are doing offer() below. - _buffer = new LinkedBlockingQueue(limit + 4); - _critBuffer = new LinkedBlockingQueue(limit + 4); + _buffer = new LinkedBlockingQueue(lim + 4); + _critBuffer = new LinkedBlockingQueue(lim + 4); } void add(String msg) { diff --git a/history.txt b/history.txt index 444268a5f3..a402d498b8 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,8 @@ +* 2011-08-23 0.8.8 released + +2011-08-23 zzz + * Tweaks after review + 2011-08-21 zzz * RateStat: Cleanups and javadoc fixes * susimail: Fix page encoding diff --git a/installer/resources/fix_logfile_path.cmd b/installer/resources/fix_logfile_path.cmd index c1dc6f2f41..2bc04137d5 100644 --- a/installer/resources/fix_logfile_path.cmd +++ b/installer/resources/fix_logfile_path.cmd @@ -1,33 +1,33 @@ -@echo off -:: fix_logfile_path.cmd -:: -:: This is a simple (and/or stupid) script whose sole purpose is to set the -:: correct path for wrapper.logfile, by explicitly setting it to use the -:: environment variable %temp%. -:: -:: On every *NIX-like system, $SYSTEM_java_io_tmpdir/wrapper.log points to a system-level -:: temp directory (/tmp on Linux, /var/tmp on BSD, etc.), but in Windows the value of %temp% -:: depends on whose account a process is running under. If the same user that installs I2P -:: is the only one that will run I2P, this isn't a problem. -:: -:: The problem comes from trying to run the process as a service, or trying to run under an -:: account other than the one that did the installation. For example if the user "Administrator" -:: installed I2P on Windows 7, the value for wrapper.logfile will be set to the hardcoded value of -:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log (if it's left at the default value of -:: $SYSTEM_java_io_tmpdir/wrapper.log. -:: -:: If user Alice tries to run I2P, the wrapper will try to write its logfile to -:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log. Unfortunately Alice -:: doesn't have the rights to access Administrator's temp directory. The same -:: will happen with the "limited access account" that the I2P service runs -:: under. -:: -:: Since Windows doesn't have sed and it has a retarded find, we resort to this -:: lameness. -:: -cd /d %~dp0 -find /V /I "wrapper.logfile=" wrapper.config > wrapper.new -echo wrapper.logfile=%%temp%%\wrapper.log >> wrapper.new -move wrapper.new wrapper.config - -:: As an added bonus, wrapper.config now has DOS line endings in Windows. +@echo off +:: fix_logfile_path.cmd +:: +:: This is a simple (and/or stupid) script whose sole purpose is to set the +:: correct path for wrapper.logfile, by explicitly setting it to use the +:: environment variable %temp%. +:: +:: On every *NIX-like system, $SYSTEM_java_io_tmpdir/wrapper.log points to a system-level +:: temp directory (/tmp on Linux, /var/tmp on BSD, etc.), but in Windows the value of %temp% +:: depends on whose account a process is running under. If the same user that installs I2P +:: is the only one that will run I2P, this isn't a problem. +:: +:: The problem comes from trying to run the process as a service, or trying to run under an +:: account other than the one that did the installation. For example if the user "Administrator" +:: installed I2P on Windows 7, the value for wrapper.logfile will be set to the hardcoded value of +:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log (if it's left at the default value of +:: $SYSTEM_java_io_tmpdir/wrapper.log. +:: +:: If user Alice tries to run I2P, the wrapper will try to write its logfile to +:: C:\Users\Administrator\AppData\Local\Temp\wrapper.log. Unfortunately Alice +:: doesn't have the rights to access Administrator's temp directory. The same +:: will happen with the "limited access account" that the I2P service runs +:: under. +:: +:: Since Windows doesn't have sed and it has a retarded find, we resort to this +:: lameness. +:: +cd /d %~dp0 +findstr /V /R "^wrapper.logfile=" wrapper.config > wrapper.new +echo wrapper.logfile=%%temp%%\wrapper.log >> wrapper.new +move wrapper.new wrapper.config + +:: As an added bonus, wrapper.config now has DOS line endings in Windows. diff --git a/installer/resources/postinstall.sh b/installer/resources/postinstall.sh index f50cf1982a..e79038b114 100644 --- a/installer/resources/postinstall.sh +++ b/installer/resources/postinstall.sh @@ -95,6 +95,7 @@ rm -rf ./icons rm -rf ./lib/wrapper rm -f ./lib/*.dll rm -f ./*.bat +rm -f ./fix_logfile_path.cmd rm -f ./*.exe rm -rf ./installer diff --git a/release_checklist.txt b/installer/resources/release_checklist.txt similarity index 100% rename from release_checklist.txt rename to installer/resources/release_checklist.txt