Update of /cvsroot/freenet/freenet/src/freenet/node/states/data
In directory sc8-pr-cvs1:/tmp/cvs-serv14016/src/freenet/node/states/data
Modified Files:
ReceiveData.java SendData.java
Log Message:
6290: don't show the request box either when in simple mode.
Index: ReceiveData.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/data/ReceiveData.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -w -r1.23 -r1.24
--- ReceiveData.java 7 Oct 2003 20:03:39 -0000 1.23
+++ ReceiveData.java 31 Oct 2003 19:21:21 -0000 1.24
@@ -60,7 +60,7 @@
public final void commit() throws IOException, KeyCollisionException {
if(Core.logger.shouldLog(Logger.DEBUG,this))
- Core.logger.log(this, "Committing "+this, Core.logger.DEBUG);
+ Core.logger.log(this, "Committing "+this, Logger.DEBUG);
if (out != null)
out.commit();
}
@@ -78,14 +78,14 @@
out.close();
}
catch (IOException e) {
- n.logger.log(this, "I/O error closing KeyOutputStream",
+ Core.logger.log(this, "I/O error closing KeyOutputStream",
e, Logger.ERROR);
}
try {
data.close();
}
catch (IOException e) {
- n.logger.log(this, "I/O error closing data receive stream",
+ Core.logger.log(this, "I/O error closing data receive stream",
e, Logger.MINOR);
}
}
@@ -110,7 +110,7 @@
inWrite = false;
int m = data.read(buffer, 0, (int) Math.min(length - moved,
buffer.length));
if(logDEBUG)
- n.logger.log(this, "Read "+m+" bytes ("+this+")",
+ Core.logger.log(this, "Read "+m+" bytes ("+this+")",
Logger.DEBUG);
if (m < 0) {
throw new IOException("Could not read all the expected "+
@@ -120,7 +120,7 @@
}
moved += m;
inWrite = true;
- if(logDEBUG) n.logger.log(this, "Moved "+moved+" of "+length+
+ if(logDEBUG) Core.logger.log(this, "Moved "+moved+" of "+length+
" bytes for "+Long.
toHexString(parent)+":"+
Long.toHexString(id)+" ("+data+")",
@@ -129,20 +129,20 @@
if (result != -1) throw new CancelledIOException();
out.write(buffer, 0, m);
if(logDEBUG)
- n.logger.log(this, "Written "+m+" bytes ("+this+")",
+ Core.logger.log(this, "Written "+m+" bytes ("+this+")",
Logger.DEBUG);
}
- if(logDEBUG) n.logger.log(this, "Closing, moved "+moved+" of "+
+ if(logDEBUG) Core.logger.log(this, "Closing, moved "+moved+" of "+
length+" bytes for "+Long.
toHexString(parent)+":"+
Long.toHexString(id)+" ("+data+")",
- Core.logger.DEBUG);
+ Logger.DEBUG);
out.close();
result = Presentation.CB_OK;
} catch (DataNotValidIOException e) {
result = e.getCode();
if(logDEBUG) {
- n.logger.log(this, "Got DNV: "+
+ Core.logger.log(this, "Got DNV: "+
Presentation.getCBdescription(result)+" for "+
this, e, Logger.DEBUG);
}
@@ -151,20 +151,20 @@
}
}
catch (CancelledIOException e) {
- if(logDEBUG) n.logger.log(this, "CancelledIOException moving data for "+
+ if(logDEBUG) Core.logger.log(this, "CancelledIOException moving data for "+
this, e, Logger.DEBUG);
} // already set result
catch (IOException e) {
result = (inWrite ? Presentation.CB_CACHE_FAILED
: Presentation.CB_RECV_CONN_DIED);
- n.logger.log(this,
+ Core.logger.log(this,
"I/O error while moving data: "+Presentation.getCBname(result)+
" for "+this, e, inWrite ? Logger.ERROR :
Logger.MINOR);
// e, Logger.ERROR);
} catch (Throwable t) {
- n.logger.log(this, "Uncaught Throwable receiving data: "+t+" for "+
+ Core.logger.log(this, "Uncaught Throwable receiving data: "+t+" for "+
this+", result="+result+", moved="+
moved+", length="+length, t, Logger.ERROR);
result = Presentation.CB_CACHE_FAILED; // umm, kinda
@@ -175,7 +175,7 @@
1 : 0);
if (result != Presentation.CB_OK) {
- if(logDEBUG) n.logger.log(this, "Failing "+this+", result="+
+ if(logDEBUG) Core.logger.log(this, "Failing "+this+", result="+
Integer.toHexString(result)+", moved="+
moved+", length="+length, Logger.DEBUG);
out.fail(result);
@@ -184,7 +184,7 @@
out.close();
}
catch (IOException e) {
- n.logger.log(this, "I/O error closing KeyOutputStream for "+
+ Core.logger.log(this, "I/O error closing KeyOutputStream for "+
this, e, Logger.ERROR);
}
}
@@ -212,7 +212,7 @@
data.close();
}
catch (IOException e) {
- n.logger.log(this, "I/O error closing data receive stream for "+
+ Core.logger.log(this, "I/O error closing data receive stream for "+
this, e, Logger.MINOR);
}
Index: SendData.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/data/SendData.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -w -r1.31 -r1.32
--- SendData.java 30 Oct 2003 01:34:04 -0000 1.31
+++ SendData.java 31 Oct 2003 19:21:21 -0000 1.32
@@ -69,7 +69,7 @@
myTWCM = new TrailerWriteCallbackMessage(id, n, this);
logDEBUG = n.logger.shouldLog(Logger.DEBUG,this);
if(logDEBUG)
- n.logger.log(this, "Creating SendData("+this+")", Logger.DEBUG);
+ Core.logger.log(this, "Creating SendData("+this+")", Logger.DEBUG);
}
public String toString() {
@@ -127,7 +127,7 @@
in.close();
closedIn = true;
} catch (IOException e) {
- n.logger.log(this, "I/O error closing KeyInputStream",
+ Core.logger.log(this, "I/O error closing KeyInputStream",
e, Logger.ERROR);
}
if(send != null) send.close();
@@ -169,9 +169,9 @@
if (isTWCM) {
waitingForWriteNotify = false;
- if (logDEBUG) n.logger.log(this, "Got " + myTWCM + " for " +
this, Logger.DEBUG);
+ if (logDEBUG) Core.logger.log(this, "Got " + myTWCM + " for "
+ this, Logger.DEBUG);
if (!myTWCM.finished) {
- n.logger.log(this, "Got a TWCM that was not finished!:
" + myTWCM + " for " + this, Logger.ERROR);
+ Core.logger.log(this, "Got a TWCM that was not
finished!: " + myTWCM + " for " + this, Logger.ERROR);
return this;
}
if (!myTWCM.success) {
@@ -238,21 +238,21 @@
protected State handleThrowable(Throwable t, boolean inWrite) {
if(logDEBUG) {
if(t == null)
- n.logger.log(this, "SendData.handleThrowable(null,"+inWrite+
+ Core.logger.log(this, "SendData.handleThrowable(null,"+inWrite+
") on "+this, Logger.DEBUG);
else
- n.logger.log(this, "SendData.handleThrowable("+t+","+inWrite+
+ Core.logger.log(this, "SendData.handleThrowable("+t+","+inWrite+
") on "+this, t, Logger.DEBUG);
}
if(t == null) {
if(result == -1)
- n.logger.log(this, "handleThrowable caller must set result if passing
null Throwable!", new Exception("grrr"), Logger.ERROR);
+ Core.logger.log(this, "handleThrowable caller must set result if
passing null Throwable!", new Exception("grrr"), Logger.ERROR);
} else if(t instanceof IOException) {
if(inWrite) result = Presentation.CB_SEND_CONN_DIED;
else {
int ifc = in.getFailureCode();
if(ifc == -1) {
- if(logDEBUG) n.logger.log(this, "Cache failed between writing "+
+ if(logDEBUG) Core.logger.log(this, "Cache failed between writing "+
"and reading for
"+Long.toHexString(id)+": "+
t, t, Logger.DEBUG);
result = Presentation.CB_CACHE_FAILED;
@@ -276,10 +276,10 @@
in.close();
closedIn = true;
} catch (IOException e) {
- n.logger.log(this, "I/O error closing KeyInputStream",
+ Core.logger.log(this, "I/O error closing KeyInputStream",
e, Logger.ERROR);
}
- n.logger.log(this, "Send failed for "+Long.toHexString(id)+
+ Core.logger.log(this, "Send failed for "+Long.toHexString(id)+
" ("+Long.toHexString(parent)+" - result="+
Long.toHexString(result)+", cause: "+t, Logger.MINOR);
if(inWrite) {
@@ -288,7 +288,7 @@
} else if(!inPaddingMode) {
if(moved == length) {
if(result == -1)
- n.logger.log(this, "WTF? moved = length in handleThrowable "+
+ Core.logger.log(this, "WTF? moved = length in handleThrowable "+
"for "+this, new Exception("debug"),
Logger.NORMAL);
} else {
@@ -336,7 +336,7 @@
byte[] stuffToSend;
long remainingPadding = paddingLength - sentPadding;
if(logDEBUG)
- n.logger.log(this, "sendWritePadding(): paddingLength="+
+ Core.logger.log(this, "sendWritePadding(): paddingLength="+
paddingLength+"/"+sentPadding+" ("+this+")",
Logger.DEBUG);
if(remainingPadding <= 0) return; // we will get finished
@@ -365,11 +365,11 @@
protected State finish() {
if (!(moved == length || (inPaddingMode && sentPadding >=
paddingLength) || (result != -1 && !inPaddingMode))) {
- n.logger.log(this, "Not finishing because moved=" + moved +
"/" + length + ", inPaddingMode=" + inPaddingMode + ", sentPadding=" + sentPadding +
"/" + paddingLength + " (" + this +")", Logger.DEBUG);
+ Core.logger.log(this, "Not finishing because moved=" + moved +
"/" + length + ", inPaddingMode=" + inPaddingMode + ", sentPadding=" + sentPadding +
"/" + paddingLength + " (" + this +")", Logger.DEBUG);
return this;
}
if (inPaddingMode && sentPadding > paddingLength)
- n.logger.log(this, "sentPadding=" + sentPadding + "/" +
paddingLength + " (" + this +")", Logger.NORMAL);
+ Core.logger.log(this, "sentPadding=" + sentPadding + "/" +
paddingLength + " (" + this +")", Logger.NORMAL);
if (result != -1) {
// We were aborted
return handleThrowable(null, false);
@@ -401,13 +401,13 @@
// }
// inWrite = true;
// if(logDEBUG)
-// n.logger.log(this, "Read "+(moved+m)+" of "+length+
+// Core.logger.log(this, "Read "+(moved+m)+" of "+length+
// " bytes for "+Long.toHexString(parent)+" ("+in+")",
// Logger.DEBUG);
// send.write(buffer, 0, m);
// moved += m;
// if(logDEBUG)
-// n.logger.log(this, "Moved "+moved+" of "+length+" bytes for "+
+// Core.logger.log(this, "Moved "+moved+" of "+length+" bytes for "+
// Long.toHexString(parent)+" ("+in+")",
// Logger.DEBUG);
// }
@@ -416,7 +416,7 @@
// result = Presentation.CB_OK;
// } catch (CancelledIOException e) {
// if(logDEBUG)
-// n.logger.log(this, "Cancelled IO: "+abortedException+" for "+
+// Core.logger.log(this, "Cancelled IO: "+abortedException+" for "+
// Long.toHexString(parent), abortedException,
// Logger.DEBUG);
// } catch (IOException e) {
@@ -426,7 +426,7 @@
// : in.getFailureCode());
// if (result == -1) // it broke some time between writing and reading
// {
-// if(logDEBUG) n.logger.log(this, "Cache failed between writing "+
+// if(logDEBUG) Core.logger.log(this, "Cache failed between writing "+
// "and reading for "+Long.toHexString(id),
// e, Logger.DEBUG);
// result = Presentation.CB_CACHE_FAILED;
@@ -465,7 +465,7 @@
// in.close();
// closedIn = true;
// } catch (IOException e) {
-// n.logger.log(this, "I/O error closing KeyInputStream",
+// Core.logger.log(this, "I/O error closing KeyInputStream",
// e, Logger.ERROR);
// }
@@ -496,7 +496,7 @@
// closedSend = true;
// }
// catch (IOException e) {
-// n.logger.log(this, "I/O error closing data send stream",
+// Core.logger.log(this, "I/O error closing data send stream",
// e, Logger.MINOR);
// }
// }
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs