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:
@ -297,26 +297,27 @@ public class SummaryHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String getTransferred(long bytes) {
|
private static String getTransferred(long bytes) {
|
||||||
|
double val = bytes;
|
||||||
int scale = 0;
|
int scale = 0;
|
||||||
if (bytes > 1024*1024*1024) {
|
if (bytes > 1024*1024*1024) {
|
||||||
// gigs transferred
|
// gigs transferred
|
||||||
scale = 3;
|
scale = 3;
|
||||||
bytes /= (1024*1024*1024);
|
val /= (double)(1024*1024*1024);
|
||||||
} else if (bytes > 1024*1024) {
|
} else if (bytes > 1024*1024) {
|
||||||
// megs transferred
|
// megs transferred
|
||||||
scale = 2;
|
scale = 2;
|
||||||
bytes /= (1024*1024);
|
val /= (double)(1024*1024);
|
||||||
} else if (bytes > 1024) {
|
} else if (bytes > 1024) {
|
||||||
// kbytes transferred
|
// kbytes transferred
|
||||||
scale = 1;
|
scale = 1;
|
||||||
bytes /= 1024;
|
val /= (double)1024;
|
||||||
} else {
|
} else {
|
||||||
scale = 0;
|
scale = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DecimalFormat fmt = new DecimalFormat("##0.00");
|
DecimalFormat fmt = new DecimalFormat("##0.00");
|
||||||
|
|
||||||
String str = fmt.format(bytes);
|
String str = fmt.format(val);
|
||||||
switch (scale) {
|
switch (scale) {
|
||||||
case 1: return str + "KB";
|
case 1: return str + "KB";
|
||||||
case 2: return str + "MB";
|
case 2: return str + "MB";
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
<input type="hidden" name="action" value="blah" />
|
<input type="hidden" name="action" value="blah" />
|
||||||
<b>Logging filename:</b>
|
<b>Logging filename:</b>
|
||||||
<input type="text" name="logfilename" size="40" value="<jsp:getProperty name="logginghelper" property="logFilePattern" />" /><br />
|
<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>
|
<b>Log record format:</b>
|
||||||
<input type="text" name="logformat" size="20" value="<jsp:getProperty name="logginghelper" property="recordPattern" />" /><br />
|
<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 />
|
<i>(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, 'm' = message)</i><br />
|
||||||
|
@ -580,7 +580,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
|||||||
while (true) {
|
while (true) {
|
||||||
long delay = BASE_RECONNECT_DELAY << i;
|
long delay = BASE_RECONNECT_DELAY << i;
|
||||||
i++;
|
i++;
|
||||||
if (delay > MAX_RECONNECT_DELAY)
|
if ( (delay > MAX_RECONNECT_DELAY) || (delay <= 0) )
|
||||||
delay = MAX_RECONNECT_DELAY;
|
delay = MAX_RECONNECT_DELAY;
|
||||||
try { Thread.sleep(delay); } catch (InterruptedException ie) {}
|
try { Thread.sleep(delay); } catch (InterruptedException ie) {}
|
||||||
|
|
||||||
|
@ -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
|
* 2004-09-08 0.4.0.1 released
|
||||||
|
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
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 String VERSION = "0.4.0.1";
|
||||||
public final static long BUILD = 0;
|
public final static long BUILD = 1;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION);
|
System.out.println("I2P Router version: " + VERSION);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
Reference in New Issue
Block a user