Update of /cvsroot/freenet/freenet/src/freenet/transport
In directory sc8-pr-cvs1:/tmp/cvs-serv17951/src/freenet/transport

Modified Files:
        NIOReader.java ThrottledSelectorLoop.java tcpConnection.java 
        tcpTransport.java 
Log Message:
6195: (mostly) asynchronous trailer writing, lots of logging improvements (most code 
supports selective logging now), bugfixes


Index: NIOReader.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/transport/NIOReader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NIOReader.java      19 Jun 2003 13:31:31 -0000      1.2
+++ NIOReader.java      18 Sep 2003 17:48:13 -0000      1.3
@@ -1,7 +1,6 @@
 /* -*- Mode: java; c-basic-indent: 4; tab-width: 4 -*- */
 package freenet.transport;
 
-
 import java.nio.*;
 public interface NIOReader extends NIOCallback {
 /**

Index: ThrottledSelectorLoop.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/transport/ThrottledSelectorLoop.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ThrottledSelectorLoop.java  10 Sep 2003 20:48:42 -0000      1.23
+++ ThrottledSelectorLoop.java  18 Sep 2003 17:48:13 -0000      1.24
@@ -161,7 +161,7 @@
                                        // Already thinks it is registered
                                }
                        } catch (CancelledKeyException e) {
-                               if(Core.logger.shouldLog(Logger.DEBUG))
+                               if(Core.logger.shouldLog(Logger.DEBUG,this))
                                        Core.logger.log(this, "Key ("+current+
                                                                        ") cancelled 
but not removed: "+e, e,
                                                                        Logger.ERROR);
@@ -171,7 +171,7 @@
                                queueClose(current);
                                closed++;
                        } catch (ClosedChannelException e) {
-                               if(Core.logger.shouldLog(Logger.DEBUG))
+                               if(Core.logger.shouldLog(Logger.DEBUG,this))
                                        Core.logger.log(this, "Key ("+current+
                                                                        ") channel 
closed but not removed: "+e,
                                                                        e, 
Logger.ERROR);

Index: tcpConnection.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/transport/tcpConnection.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- tcpConnection.java  11 Sep 2003 15:32:42 -0000      1.42
+++ tcpConnection.java  18 Sep 2003 17:48:13 -0000      1.43
@@ -108,7 +108,7 @@
     public boolean countAsThrottled() { return shouldThrottle; };
     
     public void enableThrottle() { 
-       if(Core.logger.shouldLog(Logger.DEBUG))
+       if(Core.logger.shouldLog(Logger.DEBUG,this))
            Core.logger.log(this, "Enabling throttle for "+this, 
                            new Exception("debug"), Logger.DEBUG);
        shouldThrottleNow = shouldThrottle;
@@ -191,7 +191,7 @@
        throws ConnectFailedException {
         this(t);
        
-       logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+       logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
        if(logDEBUG)
            Core.logger.log(this, "tcpConnection (outbound)", 
                            new Exception("debug"), Logger.DEBUG);
@@ -315,7 +315,7 @@
     
     protected final void logInstances(String s) {
        synchronized(profLock) {
-               if(Core.logger.shouldLog(Logger.DEBUG))
+               if(Core.logger.shouldLog(Logger.DEBUG,this))
            Core.logger.log(this, s+" ("+this+") instances: "+instances+
                            ", openInstances: "+openInstances+
                            ", created: "+createdInstances+
@@ -333,7 +333,7 @@
     tcpConnection(tcpTransport t, Socket sock, int designator,
                  boolean dontThrottle, boolean doThrottle) throws IOException {
         this(t);
-       logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+       logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
        if(logDEBUG)
            Core.logger.log(this, "tcpConnection (inbound)", Logger.DEBUG);
         
@@ -445,7 +445,7 @@
     
     public final void close(boolean fromCloseThread) {
        closeException = new Exception("debug");
-       logDEBUG =Core.logger.shouldLog(Logger.DEBUG);  
+       logDEBUG =Core.logger.shouldLog(Logger.DEBUG,this);  
        if(logDEBUG)
            Core.logger.log(this, "Closing("+fromCloseThread+
                            ") tcpConnection "+this, 
@@ -579,7 +579,7 @@
             sock.setSoTimeout(timeout);
         else
             throw new IOException("Already closed "+this);
-       if(Core.logger.shouldLog(Logger.DEBUG))
+       if(Core.logger.shouldLog(Logger.DEBUG,this))
            Core.logger.log(this, "Set SO_TIMEOUT to "+timeout+" for "+this,
                            Logger.DEBUG);
     }

Index: tcpTransport.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/transport/tcpTransport.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- tcpTransport.java   15 Jul 2003 14:15:10 -0000      1.10
+++ tcpTransport.java   18 Sep 2003 17:48:13 -0000      1.11
@@ -56,7 +56,7 @@
 
     public static boolean checkAddress(int[] i) {
        // ip address (IPV6 is not supported by this transport)
-       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,tcpTransport.class);
        if(logDEBUG)
            Core.logger.log(tcpTransport.class, "Checking "+i[0]+"."+i[1]+"."+i[2]+
                            "."+i[3], Logger.DEBUG);
@@ -101,7 +101,7 @@
     }
     
     public boolean checkAddress(String s, boolean noPort) {
-       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG);
+       boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
        if(logDEBUG)
            Core.logger.log(this, "Checking "+s, Logger.DEBUG);
        String a = s;

_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to