Update of /cvsroot/freenet/freenet/src/freenet/support
In directory sc8-pr-cvs1:/tmp/cvs-serv31167/src/freenet/support
Modified Files:
FileLoggerHook.java
Log Message:
6251:
Fix occasional NPE in ConnectionHandler.
Changes to the README and the warning fproxy sends when it detect Internet Explorer,
mostly w.r.t. Opera. Contributed by an untraceable individual who wishes to remain
nameless.
Add logOverwrite config parameter.
Make the default insert key CHK@ and the default HTL 25.
Tyop fixes in comments.
Logging, toString(), indenting.
Index: FileLoggerHook.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/FileLoggerHook.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -w -r1.34 -r1.35
--- FileLoggerHook.java 19 Sep 2003 14:33:15 -0000 1.34
+++ FileLoggerHook.java 16 Oct 2003 01:04:01 -0000 1.35
@@ -60,6 +60,8 @@
protected OutputStream uout;
+ protected boolean logOverwrite = false;
+
/* Base filename for rotating logs */
protected String baseFilename = null;
@@ -261,7 +263,7 @@
long sleepTime = 1000;
try {
System.err.println("Creating new logfile "+filename);
- return new FileOutputStream(filename,true);
+ return new FileOutputStream(filename, !logOverwrite);
} catch (IOException e) {
System.err.println("Could not create FOS "+filename+": "+e);
System.err.println("Sleeping "+sleepTime/1000+" seconds");
@@ -342,9 +344,11 @@
* @exception IOException if the file couldn't be opened for append.
*/
public FileLoggerHook(String filename, String fmt,
- String dfmt, int threshold, boolean assumeWorking)
+ String dfmt, int threshold, boolean assumeWorking,
+ boolean logOverwrite)
throws IOException {
- this(false, filename, fmt, dfmt, threshold, assumeWorking);
+ this(false, filename, fmt, dfmt, threshold, assumeWorking,
+ logOverwrite);
}
private void checkStdStreams() {
@@ -386,9 +390,11 @@
}
public FileLoggerHook(boolean rotate, String baseFilename, String fmt,
- String dfmt, int threshold, boolean assumeWorking)
+ String dfmt, int threshold, boolean assumeWorking,
+ boolean logOverwrite)
throws IOException {
this(fmt, dfmt, threshold);
+ this.logOverwrite = logOverwrite;
// System.err.println("Creating FileLoggerHook with threshold "+threshold);
if(!assumeWorking)
checkStdStreams();
@@ -396,7 +402,8 @@
lout = null;
this.baseFilename = baseFilename;
} else {
- lout = new PrintStream(new FileOutputStream(baseFilename));
+ lout = new PrintStream(new FileOutputStream(baseFilename,
+ !logOverwrite));
}
WriterThread wt = new WriterThread();
//wt.setDaemon(true);
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs