2004-09-13 jrandom

* Update for the SDK reconnection to deal with overflow.
    * Web improvements (@ not # on the /logs.jsp [thanks ugha!] and fixed the
      rounding on lifetime bandwidth used [thanks gott!]).
This commit is contained in:
jrandom
2004-09-13 03:08:16 +00:00
committed by zzz
parent e2635705f9
commit 51285efbc3
5 changed files with 15 additions and 9 deletions

View File

@ -297,26 +297,27 @@ public class SummaryHelper {
}
private static String getTransferred(long bytes) {
double val = bytes;
int scale = 0;
if (bytes > 1024*1024*1024) {
// gigs transferred
scale = 3;
bytes /= (1024*1024*1024);
val /= (double)(1024*1024*1024);
} else if (bytes > 1024*1024) {
// megs transferred
scale = 2;
bytes /= (1024*1024);
val /= (double)(1024*1024);
} else if (bytes > 1024) {
// kbytes transferred
scale = 1;
bytes /= 1024;
val /= (double)1024;
} else {
scale = 0;
}
DecimalFormat fmt = new DecimalFormat("##0.00");
String str = fmt.format(bytes);
String str = fmt.format(val);
switch (scale) {
case 1: return str + "KB";
case 2: return str + "MB";

View File

@ -29,7 +29,7 @@
<input type="hidden" name="action" value="blah" />
<b>Logging filename:</b>
<input type="text" name="logfilename" size="40" value="<jsp:getProperty name="logginghelper" property="logFilePattern" />" /><br />
<i>(the symbol '#' will be replaced during log rotation)</i><br />
<i>(the symbol '@' will be replaced during log rotation)</i><br />
<b>Log record format:</b>
<input type="text" name="logformat" size="20" value="<jsp:getProperty name="logginghelper" property="recordPattern" />" /><br />
<i>(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, 'm' = message)</i><br />

View File

@ -580,7 +580,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
while (true) {
long delay = BASE_RECONNECT_DELAY << i;
i++;
if (delay > MAX_RECONNECT_DELAY)
if ( (delay > MAX_RECONNECT_DELAY) || (delay <= 0) )
delay = MAX_RECONNECT_DELAY;
try { Thread.sleep(delay); } catch (InterruptedException ie) {}

View File

@ -1,4 +1,9 @@
$Id: history.txt,v 1.15 2004/09/08 17:15:43 hypercubus Exp $
$Id: history.txt,v 1.16 2004/09/08 21:26:43 jrandom Exp $
2004-09-13 jrandom
* Update for the SDK reconnection to deal with overflow.
* Web improvements (@ not # on the /logs.jsp [thanks ugha!] and fixed the
rounding on lifetime bandwidth used [thanks gott!]).
* 2004-09-08 0.4.0.1 released

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.28 $ $Date: 2004/09/08 17:05:35 $";
public final static String ID = "$Revision: 1.29 $ $Date: 2004/09/08 21:26:43 $";
public final static String VERSION = "0.4.0.1";
public final static long BUILD = 0;
public final static long BUILD = 1;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);