Author: toad
Date: 2005-12-08 00:48:49 +0000 (Thu, 08 Dec 2005)
New Revision: 7695
Modified:
trunk/freenet/src/freenet/node/TestnetHandler.java
trunk/freenet/src/freenet/node/Version.java
trunk/freenet/src/freenet/support/FileLoggerHook.java
Log:
293: (mandatory)
More testnet fixes, including new message.
Modified: trunk/freenet/src/freenet/node/TestnetHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/TestnetHandler.java 2005-12-08 00:26:51 UTC
(rev 7694)
+++ trunk/freenet/src/freenet/node/TestnetHandler.java 2005-12-08 00:48:49 UTC
(rev 7695)
@@ -40,7 +40,7 @@
Logger.error(this, "ANONYMITY MODE: OFF");
System.err.println("STARTING TESTNET SERVER!");
System.err.println("ANONYMITY MODE: OFF");
- System.err.println("You have no anonymity. Thank you for
running a testnet node, this will help the developers to efficiently debug
Freenet.");
+ System.err.println("You have no anonymity. Thank you for
running a testnet node, this will help the developers to efficiently debug
Freenet, by letting them automatically fetch your log files.");
System.err.println("We repeat: YOU HAVE NO ANONYMITY
WHATSOEVER. DO NOT POST ANYTHING YOU DO NOT WANT TO BE ASSOCIATED WITH.");
System.err.println("If you want a real freenet node, with
anonymity, turn off testnet mode.");
System.err.println("Note, this node will not connect to
non-testnet nodes, for security reasons. You can of course run a testnet node
and a non-testnet node.");
@@ -111,6 +111,7 @@
try {
d = df.parse(date);
} catch (ParseException e) {
+ Logger.minor(this, "Cannot
parse: "+e+" for "+date);
return;
}
node.fileLoggerHook.sendLogByContainedDate(d.getTime(), os);
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2005-12-08 00:26:51 UTC (rev
7694)
+++ trunk/freenet/src/freenet/node/Version.java 2005-12-08 00:48:49 UTC (rev
7695)
@@ -20,10 +20,10 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- public static final int buildNumber = 292;
+ public static final int buildNumber = 293;
/** Oldest build of Fred we will talk to */
- public static final int lastGoodBuild = 292;
+ public static final int lastGoodBuild = 293;
/** The highest reported build of fred */
public static int highestSeenBuild = buildNumber;
Modified: trunk/freenet/src/freenet/support/FileLoggerHook.java
===================================================================
--- trunk/freenet/src/freenet/support/FileLoggerHook.java 2005-12-08
00:26:51 UTC (rev 7694)
+++ trunk/freenet/src/freenet/support/FileLoggerHook.java 2005-12-08
00:48:49 UTC (rev 7695)
@@ -189,7 +189,6 @@
}
public void run() {
- findOldLogFiles();
File currentFilename = null;
Object o = null;
long thisTime = System.currentTimeMillis();
@@ -200,6 +199,7 @@
if (baseFilename != null) {
latestFilename = new
File(baseFilename+"-latest.log");
previousFilename = new
File(baseFilename+"-previous.log");
+ findOldLogFiles();
gc = new GregorianCalendar();
switch (INTERVAL) {
case Calendar.YEAR :
@@ -450,19 +450,14 @@
java.util.Arrays.sort(files);
long lastStartTime = -1;
File oldFile = null;
+ previousFilename.delete();
+ latestFilename.renameTo(previousFilename);
for(int i=0;i<files.length;i++) {
File f = files[i];
String name = f.getName();
if(name.toLowerCase().startsWith(prefix)) {
- if(name.equals(previousFilename)) {
- Logger.minor(this, "Deleting
"+previousFilename);
- f.delete();
+ if(name.equals(previousFilename) ||
name.equals(latestFilename))
continue;
- } else if(name.equals(latestFilename)) {
- Logger.minor(this, "Renaming latest to
previous");
- f.renameTo(previousFilename);
- continue;
- }
if(!name.endsWith(".log.gz")) {
Logger.minor(this, "Does not end in
.log.gz: "+name);
f.delete();
@@ -500,13 +495,14 @@
if(nums.length > 1)
gc.set(Calendar.YEAR, nums[1]);
if(nums.length > 2)
- gc.set(Calendar.MONTH, nums[2]);
+ gc.set(Calendar.MONTH, nums[2]-1);
if(nums.length > 3)
gc.set(Calendar.DAY_OF_MONTH, nums[3]);
if(nums.length > 4)
gc.set(Calendar.HOUR_OF_DAY, nums[4]);
if(nums.length > 5)
gc.set(Calendar.MINUTE, nums[5]);
+ gc.set(Calendar.SECOND, 0);
long startTime = gc.getTimeInMillis();
if(oldFile != null) {
long l = oldFile.length();
@@ -514,7 +510,7 @@
logFiles.addLast(olf);
oldLogFilesDiskSpaceUsage += l;
}
- lastStartTime = -1;
+ lastStartTime = startTime;
oldFile = f;
} else {
// Nothing to do with us
@@ -865,6 +861,7 @@
OldLogFile olf = (OldLogFile) i.next();
if(time >= olf.start && time < olf.end) {
toReturn = olf;
+ Logger.minor(this, "Found "+olf);
break;
}
}