Update of /cvsroot/freenet/freenet/src/freenet/client
In directory sc8-pr-cvs1:/tmp/cvs-serv14016/src/freenet/client
Modified Files:
BackgroundInserter.java FNPClient.java
SplitFileRequestManager.java AbstractClientKey.java
PutRequestProcess.java VirtualClient.java InternalClient.java
GetRequestProcess.java FECTools.java SingleRequestProcess.java
RequestManager.java SplitFileDownloader.java
Log Message:
6290: don't show the request box either when in simple mode.
Index: BackgroundInserter.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/BackgroundInserter.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -w -r1.9 -r1.10
--- BackgroundInserter.java 3 Jul 2003 03:33:42 -0000 1.9
+++ BackgroundInserter.java 31 Oct 2003 19:21:16 -0000 1.10
@@ -40,13 +40,13 @@
}
public void start() {
- //Core.logger.log(this, "Attempting to start()", Core.logger.DEBUG);
+ //Core.logger.log(this, "Attempting to start()", Logger.DEBUG);
synchronized (this) {
if (workerThread != null) {
// hmmmmm.... feeble. LATER: fix.
throw new IllegalStateException("You can only start a
BackgroundInserter once.");
}
- //Core.logger.log(this, "Starting workerThread", Core.logger.DEBUG);
+ //Core.logger.log(this, "Starting workerThread", Logger.DEBUG);
workerThread = new Thread( new Runnable() {
public void run() {
onStart();
Index: FNPClient.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/FNPClient.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -r1.12 -r1.13
--- FNPClient.java 31 Oct 2003 18:25:12 -0000 1.12
+++ FNPClient.java 31 Oct 2003 19:21:16 -0000 1.13
@@ -371,7 +371,7 @@
super(req);
this.req = req;
- ckey = AbstractClientKey.createFromInsertURI(core.getRandSource(),
+ ckey = AbstractClientKey.createFromInsertURI(Core.getRandSource(),
req.uri);
try {
ckey.setCipher(req.cipherName);
@@ -503,7 +503,7 @@
throws IOException {
int i;
- byte[] b = new byte[core.blockSize];
+ byte[] b = new byte[Core.blockSize];
while (length > 0 && ((i = processedInput.read(b, 0, (int)
Math.min(b.length,
length)))
Index: SplitFileRequestManager.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/SplitFileRequestManager.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -r1.21 -r1.22
--- SplitFileRequestManager.java 3 Jul 2003 03:33:42 -0000 1.21
+++ SplitFileRequestManager.java 31 Oct 2003 19:21:16 -0000 1.22
@@ -116,7 +116,7 @@
// SFRM doesn't have the SplitFile URI. That's why it's not
included.
Core.logger.log(this, "Disabled integrity checks because of
metadata.",
- Core.logger.DEBUG);
+ Logger.DEBUG);
doParanoidChecks = false;
}
}
@@ -695,18 +695,18 @@
return null;
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Entering wait(), state="+
stateAsString(), new Exception("debug"),
- Core.logger.DEBUG);
+ Logger.DEBUG);
wait(200);
// If we have got here, it is safe to do an incomplete wait
// JVM bugs may cause wait() to never return, so we are adding
// an argument everywhere
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Leaving wait(), state="+
stateAsString(), new Exception("debug"),
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
catch (Exception e) {
// REDFLAG: untested code path.
Index: AbstractClientKey.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/AbstractClientKey.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- AbstractClientKey.java 1 Jul 2003 18:39:17 -0000 1.8
+++ AbstractClientKey.java 31 Oct 2003 19:21:16 -0000 1.9
@@ -200,7 +200,7 @@
new DataNotValidIOException(Document.DOC_BAD_LENGTH);
Core.logger.log(this,"Total length is " + getTotalLength() +
" but transLength = " + transLength, e,
- Core.logger.DEBUG);
+ Logger.DEBUG);
throw e;
}
storables = sto;
Index: PutRequestProcess.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/PutRequestProcess.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -w -r1.17 -r1.18
--- PutRequestProcess.java 19 Sep 2003 19:02:11 -0000 1.17
+++ PutRequestProcess.java 31 Oct 2003 19:21:16 -0000 1.18
@@ -83,7 +83,7 @@
next.getError());
origThrowable = next.getThrowable();
Core.logger.log(this, "Request failed: "+error, origThrowable,
- Core.logger.MINOR);
+ Logger.MINOR);
return null;
}
}
@@ -188,7 +188,7 @@
if(v == null) v = new Vector();
if(v != null) v.clear();
dl.strongWait();
- if (r.state() != r.DONE) {
+ if (r.state() != Request.DONE) {
if(collided) {
error = "Key collision: the key "+uri+
" is already present on Freenet";
@@ -201,7 +201,7 @@
WrongStateException("after waiting for next process"+
(error == null ? "" :
(": "+error)),
- r.DONE, r.state());
+ Request.DONE, r.state());
if(error == null) error = origThrowable.toString();
failed = true;
if(bufferEvents) {
Index: VirtualClient.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/VirtualClient.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -r1.14 -r1.15
--- VirtualClient.java 30 Oct 2003 01:34:03 -0000 1.14
+++ VirtualClient.java 31 Oct 2003 19:21:16 -0000 1.15
@@ -188,7 +188,7 @@
Bucket metadata = null;
try {
- metadata = node.fecTools.getBucketFactory().makeBucket(-1);
+ metadata = Node.fecTools.getBucketFactory().makeBucket(-1);
DocumentCommand doc = new DocumentCommand(new MetadataSettings());
doc.addPart(req.sf);
@@ -203,7 +203,7 @@
// Hmmmm...
// Why doesn' h&m just contain a header array and block array?
FECTools.HeaderAndMap[] ret =
- node.fecTools.segmentSplitFile(0, metadata);
+ Node.fecTools.segmentSplitFile(0, metadata);
req.headers = new SegmentHeader[ret.length];
req.maps = new BlockMap[ret.length];
for (int i = 0; i < ret.length; i++) {
@@ -217,7 +217,7 @@
}
finally {
if (metadata != null) {
- node.fecTools.getBucketFactory().freeBucket(metadata);
+ Node.fecTools.getBucketFactory().freeBucket(metadata);
}
}
}
@@ -237,7 +237,7 @@
Bucket[] ret = null;
try {
- ret = node.fecTools.decodeSegment(req.header,
+ ret = Node.fecTools.decodeSegment(req.header,
req.dataIndices,
withOffset,
req.requestedIndices,
@@ -249,7 +249,7 @@
}
}
finally {
- BucketTools.freeBuckets(node.fecTools.getBucketFactory(), ret);
+ BucketTools.freeBuckets(Node.fecTools.getBucketFactory(), ret);
}
}
@@ -265,13 +265,13 @@
// REDFLAG: Completely untested.
public void execute(SegmentFileRequest req) throws Exception {
- req.headers = node.fecTools.segmentFile(-1, req.algoName, req.length);
+ req.headers = Node.fecTools.segmentFile(-1, req.algoName, req.length);
}
public void execute(EncodeSegmentRequest req) throws Exception {
Bucket[] ret = null;
try {
- ret = node.fecTools.encodeSegment(req.header,
+ ret = Node.fecTools.encodeSegment(req.header,
req.checkIndices,
req.data);
// deep copy
@@ -280,12 +280,12 @@
}
}
finally {
- BucketTools.freeBuckets(node.fecTools.getBucketFactory(), ret);
+ BucketTools.freeBuckets(Node.fecTools.getBucketFactory(), ret);
}
}
public void execute(MakeMetadataRequest req) throws Exception {
- node.fecTools.makeSplitFile(req.headers, req.maps,
+ Node.fecTools.makeSplitFile(req.headers, req.maps,
req.description, req.mimeType, req.checksum,
req.metaData);
}
Index: InternalClient.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/InternalClient.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -r1.30 -r1.31
--- InternalClient.java 27 Oct 2003 14:45:18 -0000 1.30
+++ InternalClient.java 31 Oct 2003 19:21:16 -0000 1.31
@@ -30,7 +30,7 @@
if(node == null)
throw new IllegalArgumentException("null node pointer to "+
"InternalClient");
- vc = new VirtualClient(node, node.getRandSource(), node.bf);
+ vc = new VirtualClient(node, Core.getRandSource(), node.bf);
}
public boolean isOverloaded() {
@@ -45,13 +45,13 @@
IOException, KeyException {
if (req instanceof GetRequest) {
return new ClientMessageVector(
- new NewInternalGet(node.getRandSource().nextLong(),
+ new NewInternalGet(Core.getRandSource().nextLong(),
new InternalGetToken((GetRequest) req))
);
}
else if (req instanceof PutRequest) {
return new ClientMessageVector(
- new NewInternalPut(node.getRandSource().nextLong(),
+ new NewInternalPut(Core.getRandSource().nextLong(),
new InternalPutToken((PutRequest) req))
);
}
@@ -245,9 +245,9 @@
skipBytes = dcos.chunkPos;
if(skipBytes != 0)
if(Core.logger.shouldLog(Logger.DEBUG,this))
- Core.logger.log(this, "Restarting InternalClient
request for "+clientKey+", next pass will skip first "+skipBytes, Core.logger.MINOR);
+ Core.logger.log(this, "Restarting InternalClient
request for "+clientKey+", next pass will skip first "+skipBytes, Logger.MINOR);
else
- Core.logger.log(this, "Restarting InternalClient
request for a clientKey, next pass will skip first "+skipBytes, Core.logger.MINOR);
+ Core.logger.log(this, "Restarting InternalClient
request for a clientKey, next pass will skip first "+skipBytes, Logger.MINOR);
}
}
}
@@ -288,7 +288,7 @@
public InternalGetToken(GetRequest req) {
super(req);
this.req = req;
- this.req.htl = node.perturbHTL(this.req.htl);
+ this.req.htl = Node.perturbHTL(this.req.htl);
req.addEventListener(new TransferCompleteListener());
}
@@ -403,7 +403,7 @@
public InternalPutToken(PutRequest req) {
super(req);
this.req = req;
- this.req.htl = node.perturbHTL(this.req.htl);
+ this.req.htl = Node.perturbHTL(this.req.htl);
}
public final void dataNotFound(Node n, long timeOfQuery,
@@ -523,7 +523,7 @@
Core.logger.log(this, "Received: "+mo+" for "+this,
Logger.DEBUG);
- node.diagnostics.occurrenceCounting("inboundClientRequests", 1);
+ Core.diagnostics.occurrenceCounting("inboundClientRequests", 1);
ClientEvent evt = null;
State s = null;
@@ -556,7 +556,7 @@
this.ft = ft;
// set up ClientKey
- ft.clientKey =
AbstractClientKey.createFromInsertURI(node.getRandSource(), ft.req.uri);
+ ft.clientKey =
AbstractClientKey.createFromInsertURI(Core.getRandSource(), ft.req.uri);
try {
ft.clientKey.setCipher(ft.req.cipherName);
}
@@ -594,7 +594,7 @@
}
catch (BadAddressException e) {
// should be impossible
- node.logger.log(this, "Got mystery exception", e,
+ Core.logger.log(this, "Got mystery exception", e,
node.logger.ERROR);
ctStream.close();
throw new IOException("Got mystery exception: "+e);
Index: GetRequestProcess.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/GetRequestProcess.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -w -r1.32 -r1.33
--- GetRequestProcess.java 30 Oct 2003 01:34:03 -0000 1.32
+++ GetRequestProcess.java 31 Oct 2003 19:21:16 -0000 1.33
@@ -121,7 +121,7 @@
Logger.DEBUG);
//if(aborted) return null; - this would leave a Client running...
nextLevel = true;
- if (r.state() == r.DONE) {
+ if (r.state() == Request.DONE) {
try {
//System.err.println("QUACK: " + msettings);
if(logDEBUG)
@@ -246,7 +246,7 @@
if(origThrowable == null)
origThrowable =
- new WrongStateException(error, r.DONE, r.state());
+ new WrongStateException(error, Request.DONE, r.state());
return null;
}
Index: FECTools.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/FECTools.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -w -r1.13 -r1.14
--- FECTools.java 30 Oct 2003 01:34:03 -0000 1.13
+++ FECTools.java 31 Oct 2003 19:21:17 -0000 1.14
@@ -584,9 +584,9 @@
mimeType = "application/octet-stream";
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "description: "+description+", mimeType: "+
- mimeType+", bucket: "+metadata, Core.logger.DEBUG);
+ mimeType+", bucket: "+metadata, Logger.DEBUG);
int blockCount = 0;
int checkBlockCount = 0;
@@ -597,7 +597,7 @@
}
Core.logger.log(this, "blockCount="+blockCount+", checkBlockCount="+
- checkBlockCount, Core.logger.DEBUG);
+ checkBlockCount, Logger.DEBUG);
String[] dataBlocks = new String[blockCount];
String[] checkBlocks = new String[checkBlockCount];
@@ -640,43 +640,43 @@
dataBlocks, checkBlocks,
headers[0].getFECAlgorithm());
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Got SplitFile", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Got SplitFile", Logger.DEBUG);
DocumentCommand doc = new DocumentCommand(new MetadataSettings());
InfoPart info = new InfoPart(description, mimeType, checksum);
doc.addPart(info);
doc.addPart(sf);
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Constructed doc", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Constructed doc", Logger.DEBUG);
Metadata md = new Metadata(new MetadataSettings());
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Got metadata", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Got metadata", Logger.DEBUG);
md.addDocument(doc);
OutputStream os;
try {
os = metadata.getOutputStream();
} catch (Throwable e) {
Core.logger.log(this, "Getting OutputStream for metadata failed:",
- e, Core.logger.DEBUG);
+ e, Logger.DEBUG);
os = new freenet.support.io.NullOutputStream();
}
md.writeTo(os);
os.close();
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
md.writeTo(Core.logStream);
if(metadata.size() == 0) throw new IOException
("written zero length metadata");
}
catch (InvalidPartException ivp) {
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Got Exception in makeSplitFile", ivp,
- Core.logger.DEBUG);
+ Logger.DEBUG);
throw new IOException("Couldn't create SplitFile metadata.");
}
Core.logger.log(this, "Metadata size now: "+metadata.size(),
- Core.logger.DEBUG);
+ Logger.DEBUG);
if(metadata.size() == 0) throw new IOException
("Something left metadata size at 0");
}
Index: SingleRequestProcess.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/SingleRequestProcess.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -r1.2 -r1.3
--- SingleRequestProcess.java 21 Nov 2002 01:36:16 -0000 1.2
+++ SingleRequestProcess.java 31 Oct 2003 19:21:17 -0000 1.3
@@ -40,7 +40,7 @@
}
public synchronized void abort() {
- if (dr.state() != dr.DONE) {
+ if (dr.state() != Request.DONE) {
error = "aborted";
origThrowable = new Exception("aborted");
aborted = true;
@@ -59,7 +59,7 @@
} else {
if(dr.state() != Request.DONE) {
origThrowable = new WrongStateException("waiting for Request",
- dr.DONE, dr.state());
+ Request.DONE, dr.state());
error = origThrowable.toString();
return true;
} else return false;
Index: RequestManager.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/RequestManager.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -r1.21 -r1.22
--- RequestManager.java 18 Sep 2003 17:48:05 -0000 1.21
+++ RequestManager.java 31 Oct 2003 19:21:17 -0000 1.22
@@ -37,7 +37,7 @@
this.maxThreads = maxThreads;
this.nonLocal = nonLocal;
this.bf = bf;
- this.logDEBUG = Core.logger.shouldLog(Core.logger.DEBUG);
+ this.logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
}
volatile boolean notified; // helper for broken JVMs (including Sun!)
@@ -95,7 +95,7 @@
// times. We just ignore calls other than the first.
if(logDEBUG)
Core.logger.log(this, "Ignored null ref in handleDone.",
- Core.logger.DEBUG);
+ Logger.DEBUG);
return;
}
@@ -192,7 +192,7 @@
requestQueue.addElement(i);
if(logDEBUG)
Core.logger.log(this, "Queued request, queue length "+requestQueue.size(),
- Core.logger.DEBUG);
+ Logger.DEBUG);
notified = true;
notifyAll();
}
@@ -323,7 +323,7 @@
synchronized Request getNextRequest() throws IOException, InterruptedException {
if(logDEBUG)
Core.logger.log(this, "getNextRequest()", new Exception("debug"),
- Core.logger.DEBUG);
+ Logger.DEBUG);
for (;;) {
if (state == STATE_DONE ||
state == STATE_FAILED ||
@@ -331,7 +331,7 @@
if(logDEBUG)
Core.logger.log(this,
"Returning null because done, failed or cancelled",
- Core.logger.DEBUG);
+ Logger.DEBUG);
return null;
}
@@ -339,7 +339,7 @@
// Our work is done.
if(logDEBUG)
Core.logger.log(this, "Returning null because no more work",
- Core.logger.DEBUG);
+ Logger.DEBUG);
return null;
}
@@ -358,13 +358,13 @@
// Our work is done.
if(logDEBUG)
Core.logger.log(this, "Returning an actual request",
- Core.logger.DEBUG);
+ Logger.DEBUG);
return r;
}
if(logDEBUG)
Core.logger.log(this, "Waiting() in getNextRequest",
- Core.logger.DEBUG);
+ Logger.DEBUG);
while(!notified) {
wait(200);
}
@@ -495,13 +495,13 @@
if(logDEBUG)
Core.logger.log(this, "Constructed RetryableInfo("+
RequestManager.this.getClass().getName()+
- "): "+toString(), Core.logger.DEBUG);
+ "): "+toString(), Logger.DEBUG);
}
void rawEvent(ClientEvent ce) {
if(logDEBUG)
Core.logger.log(this, "RetryableInfo RAW EVENT: "+ce+
- " for "+this, Core.logger.DEBUG);
+ " for "+this, Logger.DEBUG);
//System.err.println("RAW EVENT [" + req + "]: " + ce.getDescription());
switch (ce.getCode()) {
case RouteNotFoundEvent.code:
@@ -510,14 +510,14 @@
case ErrorEvent.code:
if(logDEBUG)
Core.logger.log(this, "Set reason to "+reason+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
reason = ce;
break;
case RestartedEvent.code:
if(logDEBUG)
Core.logger.log(this, "Restarted: "+ce+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
produceEvent( new BlockRestartedEvent(headers[currentSegment],
downloading,
index,
isData,
@@ -527,7 +527,7 @@
case TransferEvent.code:
if(logDEBUG)
Core.logger.log(this, "TransferEvent: "+ce+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
// REDFLAG: look at how I did this for manifest tools.
// Weird numbers ???
produceEvent( new BlockTransferringEvent(headers[currentSegment],
downloading,
@@ -540,7 +540,7 @@
case TransferStartedEvent.code:
if(logDEBUG)
Core.logger.log(this, "TransferStartedEvent: "+ce+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
produceEvent( new
BlockStartedTransferringEvent(headers[currentSegment],
downloading,
index, isData,
@@ -550,7 +550,7 @@
case PendingEvent.code:
if(logDEBUG)
Core.logger.log(this, "PendingEvent: "+ce+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
produceEvent( new BlockPendingEvent(headers[currentSegment],
downloading,
index,
isData,
@@ -561,13 +561,13 @@
case StateReachedEvent.code:
if(logDEBUG)
Core.logger.log(this, "StateReachedEvent: "+ce+" for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
int stateReached = ((StateReachedEvent)ce).getState();
switch(stateReached) {
case Request.PREPARED:
if(logDEBUG)
Core.logger.log(this, "Reached state PREPARED - for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
started = true;
produceEvent( new BlockStartedEvent(headers[currentSegment],
downloading,
index,
@@ -580,7 +580,7 @@
if(logDEBUG)
Core.logger.log(this, "Reached a terminal event "+
stateAsString(stateReached)+
- " for "+this, Core.logger.DEBUG);
+ " for "+this, Logger.DEBUG);
int ec = SplitFileEvent.SUCCEEDED;
if (((StateReachedEvent)ce).getState() == Request.FAILED) {
ec = SplitFileEvent.FAILED;
@@ -591,7 +591,7 @@
if(logDEBUG)
Core.logger.log(this, "Set suggestedExitCode to "+
- stateAsString(ec), Core.logger.DEBUG);
+ stateAsString(ec), Logger.DEBUG);
// Defer posting event to the subclass done implementation.
RetryableInfo.this.suggestedExitCode = ec;
@@ -625,13 +625,13 @@
void notifySuccess() {
if(logDEBUG)
Core.logger.log(this, "Got notifySuccess() for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
synchronized (RequestManager.this) {
successes++;
if(logDEBUG)
Core.logger.log(this, "Synchronized on RequestManager: "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
produceEvent( new BlockFinishedEvent(headers[currentSegment],
downloading,
index,
@@ -646,7 +646,7 @@
if(logDEBUG)
Core.logger.log(this, "Set targetState as
successes="+successes+
", successRequired="+successesRequired+" for "+
- this, Core.logger.DEBUG);
+ this, Logger.DEBUG);
setState(targetState);
// Subclass calls cancelAll() on client thread.
}
@@ -656,17 +656,17 @@
void notifyFailure() {
if(logDEBUG)
Core.logger.log(this, "notifyFailure() on "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
synchronized (RequestManager.this) {
if(logDEBUG)
Core.logger.log(this, "Synchronized on RequestManager.this for "+
- this, Core.logger.DEBUG);
+ this, Logger.DEBUG);
if ((retryCount < retries) &&
(state == workingState)) {
if(logDEBUG)
Core.logger.log(this, "Retrying "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
retryCount++;
@@ -682,7 +682,7 @@
requeued = true;
if(logDEBUG)
Core.logger.log(this, "Requeued "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
produceEvent( new BlockRequeuedEvent(headers[currentSegment],
downloading,
index,
isData,
@@ -695,7 +695,7 @@
Core.logger.log(this, "Failed failures="+failures+
", successes="+successes+
", successesRequired="+successesRequired+
- " for "+this, Core.logger.DEBUG);
+ " for "+this, Logger.DEBUG);
produceEvent( new BlockFinishedEvent(headers[currentSegment],
downloading,
index,
isData,
@@ -715,7 +715,7 @@
if(logDEBUG)
Core.logger.log(this, "Failure for "+this+" caused: "+
- errorMsg, Core.logger.DEBUG);
+ errorMsg, Logger.DEBUG);
setState(STATE_FAILING);
// NOTE:
@@ -731,15 +731,15 @@
void done(boolean success) {
if(logDEBUG)
Core.logger.log(this, "RetryableInfo.done("+success+") for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
synchronized (RequestManager.this) {
if(logDEBUG)
Core.logger.log(this, "Synchronized(RequestManager.this) for
"+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
if (!started) {
if(logDEBUG)
Core.logger.log(this, "Done but not started! for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
// This is to handle really bad error conditions where the
// request is executed but never makes it to the PREPARED
// state.
@@ -761,7 +761,7 @@
"or segment - segment: "+segment+"->"+
currentSegment+", state:
"+stateAsString(state)+
"(should be "+stateAsString(workingState)+") "+
- this, Core.logger.DEBUG);
+ this, Logger.DEBUG);
produceEvent( new BlockFinishedEvent(headers[currentSegment],
downloading,
index,
isData,
@@ -777,18 +777,18 @@
if (success) {
if(logDEBUG)
Core.logger.log(this, "Got success for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
if (!chain()) {
notifySuccess();
} else {
if(logDEBUG)
Core.logger.log(this, "Chain says don't pass on success "+
- "for "+this, Core.logger.DEBUG);
+ "for "+this, Logger.DEBUG);
}
} else {
if(logDEBUG)
Core.logger.log(this, "Got failure for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
notifyFailure();
}
}
@@ -798,7 +798,7 @@
// Default behaviour is for downloading
if(logDEBUG)
Core.logger.log(this, "Cleanup("+success+") for "+this,
- Core.logger.DEBUG);
+ Logger.DEBUG);
requeued = false;
if (data != null) {
try {bf.freeBucket(data);} catch (Exception e) {}
@@ -835,12 +835,12 @@
try {
if(logDEBUG)
Core.logger.log(this, "Executing", new Exception("debug"),
- Core.logger.DEBUG);
+ Logger.DEBUG);
Request r = getNextRequest();
while (r != null) {
if(logDEBUG)
Core.logger.log(this, "getNextRequest returned non-NULL",
- Core.logger.DEBUG);
+ Logger.DEBUG);
Client c = f.getClient(r);
RequestInfo i = (RequestInfo)workingMap.get(r);
assertTrue(i != null);
@@ -852,18 +852,18 @@
}
if(logDEBUG)
Core.logger.log(this, "getNextRequest returned NULL",
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
catch (Exception e) {
if(logDEBUG)
Core.logger.log(this, "Got exception in execute(): ", e,
- Core.logger.DEBUG);
+ Logger.DEBUG);
System.err.println("--- uh ooh ---");
e.printStackTrace();
}
finally {
if(logDEBUG)
- Core.logger.log(this, "Finalizing in execute()", Core.logger.DEBUG);
+ Core.logger.log(this, "Finalizing in execute()", Logger.DEBUG);
if (!groovy &&
(!(state == STATE_DONE ||
state == STATE_FAILED ||
@@ -878,14 +878,14 @@
catch (Exception e) {
if(logDEBUG)
Core.logger.log(this, "Ignoring exception in execute: ",
- e, Core.logger.DEBUG);
+ e, Logger.DEBUG);
System.err.println("RequestManager.execute -- IGNORED EXCEPTION");
e.printStackTrace();
}
}
}
if(logDEBUG)
- Core.logger.log(this, "Leaving execute()", Core.logger.DEBUG);
+ Core.logger.log(this, "Leaving execute()", Logger.DEBUG);
}
public String stateAsString() {
Index: SplitFileDownloader.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/SplitFileDownloader.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -w -r1.10 -r1.11
--- SplitFileDownloader.java 24 Jun 2003 23:17:05 -0000 1.10
+++ SplitFileDownloader.java 31 Oct 2003 19:21:17 -0000 1.11
@@ -621,33 +621,33 @@
if (!stopping) {
stopping = pingConnection();
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "early: nPending = "+nPending+
", nThreads = "+
nThreads+", rq.size = "+
requestQueue.size() + ", stopping = "+
stopping + ", startedCanceling = "+
- startedCanceling, Core.logger.DEBUG);
+ startedCanceling, Logger.DEBUG);
if (stopping && (!startedCanceling)) {
needToCancel = true;
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Continuing as stopping",
- Core.logger.DEBUG);
+ Logger.DEBUG);
continue unsynchronized_loop;
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Still here", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Still here", Logger.DEBUG);
// Start tasks.
while ((nPending < nThreads) &&
(requestQueue.size() > 0) &&
(!stopping)) {
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "In runRequests.while: "+
"nPending = "+nPending+", nThreads = "+
nThreads+", rq.size = "+
requestQueue.size(),
- Core.logger.DEBUG);
+ Logger.DEBUG);
BlockRequest request = null;
// hmmm...
@@ -661,7 +661,7 @@
try {
Client c = factory.getClient(request);
request.setClient(c);
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "requesting block " +
request.getBlockNumber(),
Logger.DEBUGGING);
@@ -671,48 +671,48 @@
}
catch (Throwable uho) {
Core.logger.log(this, "IGNORED EXCEPTION", uho,
- Core.logger.MINOR);
+ Logger.MINOR);
System.err.println("IGNORED EXCEPTION: ");
uho.printStackTrace();
cancel();
t = uho; // hmmm... Exception masking
}
finally {
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this,
"Running runRequests.finally",
- Core.logger.DEBUG);
+ Logger.DEBUG);
if (reallyStarted) {
runningRequests.addElement(request);
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Added element "+request,
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
else {
nPending--;
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "nPending now "+nPending,
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
}
// REDFLAG: Stall???
try {
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Trying...", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Trying...", Logger.DEBUG);
SplitFileDownloader.this.wait(POLLINGINTERVAL_MS);
}
catch (InterruptedException ie) {
t = ie; // hmmm... Exception masking
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Leaving...", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Leaving...", Logger.DEBUG);
}
}
break unsynchronized_loop;
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
- Core.logger.log(this, "Out of while()", Core.logger.DEBUG);
+ if(Core.logger.shouldLog(Logger.DEBUG))
+ Core.logger.log(this, "Out of while()", Logger.DEBUG);
// Throw only after all pending requests have been
// canceled.
if (t != null) {
@@ -724,15 +724,15 @@
}
else {
// Somewhat underwhelming style.
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "runRequests throwing because: ",
- t, Core.logger.DEBUG);
+ t, Logger.DEBUG);
throw new IOException(t.toString());
}
}
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "Exiting runRequests without throwing",
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
public class RunnableImpl implements Runnable {
@@ -762,7 +762,7 @@
} while (moreSegments && (!failing));
}
catch (Exception e) {
- if (Core.logger.shouldLog(Core.logger.DEBUG))
+ if (Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, e.toString(), Logger.DEBUGGING);
e.printStackTrace();
// So that we can distinguish user abort
@@ -793,7 +793,7 @@
else {
Core.logger.log(this, "run(): successes="+successes+
" requiredSuccesses="+requiredSuccesses+
- " failing="+failing, Core.logger.NORMAL);
+ " failing="+failing, Logger.NORMAL);
setState(FAILED);
}
// Note:
@@ -919,7 +919,7 @@
//hmmm perhaps too vociferous even for debug logging
//heh, you should see NativeFSDirectory.java :) - amphibian
- if(Core.logger.shouldLog(Core.logger.DEBUG))
+ if(Core.logger.shouldLog(Logger.DEBUG))
Core.logger.log(this, "block: " + blockNumber + " " +
ce.getDescription(),
Logger.DEBUGGING);
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs