Update of /cvsroot/freenet/freenet/src/freenet/support/io
In directory sc8-pr-cvs1:/tmp/cvs-serv14016/src/freenet/support/io
Modified Files:
ThrottledInputStream.java Bandwidth.java NIOOutputStream.java
Log Message:
6290: don't show the request box either when in simple mode.
Index: ThrottledInputStream.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/io/ThrottledInputStream.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- ThrottledInputStream.java 18 Sep 2003 17:48:13 -0000 1.5
+++ ThrottledInputStream.java 31 Oct 2003 19:21:18 -0000 1.6
@@ -66,18 +66,18 @@
public int read() throws IOException {
boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
- if(logDEBUG) Core.logger.log(this, "read()", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "read()", Logger.DEBUG);
int rv = super.read();
- if(logDEBUG) Core.logger.log(this, "done super.read()", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "done super.read()", Logger.DEBUG);
if(disabled) return rv;
if (rv != -1)
bandwidth.chargeBandwidth(1);
- if(logDEBUG) Core.logger.log(this, "Charged", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "Charged", Logger.DEBUG);
if(reservedBandwidth>0){
bandwidth.putBandwidth(reservedBandwidth);
reservedBandwidth = 0;
}
- if(logDEBUG) Core.logger.log(this, "Put", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "Put", Logger.DEBUG);
return rv;
}
@@ -94,9 +94,9 @@
throws IOException
{
boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
- if(logDEBUG) Core.logger.log(this, "read(,,)", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "read(,,)", Logger.DEBUG);
int rv = in.read(data, offset, length);
- if(logDEBUG) Core.logger.log(this, "super.read(,,) done", Core.logger.DEBUG);
+ if(logDEBUG) Core.logger.log(this, "super.read(,,) done", Logger.DEBUG);
if(disabled) return rv;
if (rv > 0) {
bandwidth.chargeBandwidth(rv);
Index: Bandwidth.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/io/Bandwidth.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -w -r1.28 -r1.29
--- Bandwidth.java 30 Oct 2003 01:34:03 -0000 1.28
+++ Bandwidth.java 31 Oct 2003 19:21:18 -0000 1.29
@@ -76,11 +76,11 @@
boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
if(logDEBUG)
Core.logger.log(this, "chargeBandwidth("+used+")",
- new Exception("debug"), Core.logger.DEBUG);
+ new Exception("debug"), Logger.DEBUG);
synchronized(this) {
if(logDEBUG)
Core.logger.log(this, "chargeBandwidth("+used+") synchronized",
- Core.logger.DEBUG);
+ Logger.DEBUG);
if(used<0){
Core.logger.log(this.getClass(),"used="+used+" seems unreasonable
bandwidth to charge",Logger.ERROR);
return;
@@ -93,7 +93,7 @@
}
if(logDEBUG)
Core.logger.log(this, "Leaving chargeBandwidth("+used+")",
- Core.logger.DEBUG);
+ Logger.DEBUG);
}
public class BandwidthToken {
@@ -114,12 +114,12 @@
int sleepTime = 0;
if(logDEBUG)
Core.logger.log(this, "chargeBandwidthAsync("+used+")",
- new Exception("debug"), Core.logger.DEBUG);
+ new Exception("debug"), Logger.DEBUG);
BandwidthToken bt = new BandwidthToken();
synchronized(this) {
if(logDEBUG)
Core.logger.log(this, "chargeBandwidth("+used+") synchronized",
- Core.logger.DEBUG);
+ Logger.DEBUG);
if(used<0){
Core.logger.log(this.getClass(),"used="+used+" seems unreasonable
bandwidth to charge",Logger.ERROR);
bt.availableNow = 0;
@@ -181,11 +181,11 @@
boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
if(logDEBUG)
Core.logger.log(this, "getBandwidth("+desired+")",
- new Exception("debug"), Core.logger.DEBUG);
+ new Exception("debug"), Logger.DEBUG);
synchronized(this) {
if(logDEBUG)
Core.logger.log(this, "getBandwidth("+desired+") synchronized",
- Core.logger.DEBUG);
+ Logger.DEBUG);
if(desired<0) {
Core.logger.log(this.getClass(),"desired="+desired+" seems
unreasonable bandwidth to ask for",Logger.NORMAL);
return desired;
@@ -196,7 +196,7 @@
totalUsed += result;
if(logDEBUG)
Core.logger.log(this, "Leaving getBandwidth("+desired+")",
- Core.logger.DEBUG);
+ Logger.DEBUG);
return result;
}
}
@@ -213,7 +213,7 @@
int millisToSleep = 0;
while((millisToSleep = waitForBandwidthAsync(desired)) > 0) {
try {
- Thread.currentThread().sleep(millisToSleep);
+ Thread.sleep(millisToSleep);
} catch (InterruptedException e) {}
}
}
@@ -250,7 +250,7 @@
Core.logger.log(this, "Bandwidth waiting "+millisToSleep+
", total so far "+totalWaitMillis+"; available="+
available+", desired="+desired,millisToSleep>500?
- Core.logger.MINOR:Core.logger.DEBUG);
+ Logger.MINOR:Logger.DEBUG);
totalWaitMillis += millisToSleep;
return (int)millisToSleep;
}
Index: NIOOutputStream.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/support/io/NIOOutputStream.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -r1.20 -r1.21
--- NIOOutputStream.java 17 Oct 2003 23:02:02 -0000 1.20
+++ NIOOutputStream.java 31 Oct 2003 19:21:18 -0000 1.21
@@ -3,6 +3,7 @@
import java.io.*;
import freenet.transport.*;
+
import java.nio.channels.*;
import java.net.SocketException;
import freenet.support.*;
@@ -72,7 +73,7 @@
if (dead) {
throw new SocketException("Connection already closed");
}
- if(!wsl.send(b,chan,this,wsl.NEGOTIATION)) // trailers are CH.CHOS
+ if(!wsl.send(b,chan,this,WriteSelectorLoop.NEGOTIATION)) // trailers
are CH.CHOS
throw new SocketException("Couldn't send data: WSL.send
returned false");
if(logDEBUG)
Core.logger.log(this, "Sent write of "+b.length+
@@ -118,7 +119,7 @@
Core.logger.log(this, "Trying to write "+len+" bytes to "+chan+
" ("+this+")", new
Exception("debug"),
Logger.DEBUG);
- if(!wsl.send(b,off,len,chan,this,wsl.NEGOTIATION))
+ if(!wsl.send(b,off,len,chan,this,WriteSelectorLoop.NEGOTIATION))
throw new SocketException("Could not send data: WSL.send
returned false");
try {
long now = System.currentTimeMillis();
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs