Author: toad
Date: 2007-03-31 15:55:47 +0000 (Sat, 31 Mar 2007)
New Revision: 12472
Modified:
trunk/freenet/src/freenet/node/fcp/ClientGet.java
trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
trunk/freenet/src/freenet/node/fcp/FCPMessage.java
Log:
logging etc
Modified: trunk/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGet.java 2007-03-31 15:42:20 UTC
(rev 12471)
+++ trunk/freenet/src/freenet/node/fcp/ClientGet.java 2007-03-31 15:55:47 UTC
(rev 12472)
@@ -4,13 +4,12 @@
package freenet.node.fcp;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import freenet.client.FetchContext;
import freenet.client.FetchException;
import freenet.client.FetchResult;
-import freenet.client.FetchContext;
import freenet.client.InserterException;
import freenet.client.async.BaseClientPutter;
import freenet.client.async.ClientCallback;
@@ -24,7 +23,6 @@
import freenet.support.Logger;
import freenet.support.SimpleFieldSet;
import freenet.support.api.Bucket;
-import freenet.support.io.BucketTools;
import freenet.support.io.CannotCreateFromFieldSetException;
import freenet.support.io.FileBucket;
import freenet.support.io.NullBucket;
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
2007-03-31 15:42:20 UTC (rev 12471)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
2007-03-31 15:55:47 UTC (rev 12472)
@@ -67,6 +67,8 @@
FCPMessage msg;
try {
+ if(Logger.shouldLog(Logger.DEBUG, this))
+ Logger.debug(this, "Incoming FCP
message:\n"+messageType+'\n'+fs.toString());
msg = FCPMessage.create(messageType, fs,
handler.bf, handler.server.core.persistentTempBucketFactory);
if(msg == null) continue;
} catch (MessageInvalidException e) {
@@ -96,10 +98,8 @@
continue;
}
try {
- if(Logger.shouldLog(Logger.DEBUG, this)) {
- Logger.debug(this, "Incoming FCP
message:\n"+fs.toString());
- Logger.debug(this, "Being handled by
"+msg+" on "+handler);
- }
+ if(Logger.shouldLog(Logger.DEBUG, this))
+ Logger.debug(this, "Parsed message:
"+msg+" for "+handler);
msg.run(handler, handler.server.node);
} catch (MessageInvalidException e) {
FCPMessage err = new
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, e.global);
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
2007-03-31 15:42:20 UTC (rev 12471)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionOutputHandler.java
2007-03-31 15:55:47 UTC (rev 12472)
@@ -66,6 +66,8 @@
}
public void queue(FCPMessage msg) {
+ if(Logger.shouldLog(Logger.DEBUG, this))
+ Logger.debug(this, "Queueing "+msg, new
Exception("debug"));
if(msg == null) throw new NullPointerException();
synchronized(outQueue) {
outQueue.add(msg);
Modified: trunk/freenet/src/freenet/node/fcp/FCPMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPMessage.java 2007-03-31 15:42:20 UTC
(rev 12471)
+++ trunk/freenet/src/freenet/node/fcp/FCPMessage.java 2007-03-31 15:55:47 UTC
(rev 12472)
@@ -18,7 +18,7 @@
os.write((getName()+ '\n').getBytes("UTF-8"));
os.write(msg.getBytes("UTF-8"));
if(Logger.shouldLog(Logger.DEBUG, this)) {
- Logger.debug(this, "Outgoing FCP
message:\n"+sfs.toString());
+ Logger.debug(this, "Outgoing FCP
message:\n"+getName()+'\n'+sfs.toString());
Logger.debug(this, "Being handled by "+this);
}
}