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

Modified Files:
        PeerPacketMessage.java OpenConnectionManager.java 
        ConnectionHandler.java 
Log Message:
Some quite important if(logDEBUG):s

Index: PeerPacketMessage.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/PeerPacketMessage.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -r1.14 -r1.15
--- PeerPacketMessage.java      21 Oct 2003 08:36:19 -0000      1.14
+++ PeerPacketMessage.java      22 Oct 2003 12:32:06 -0000      1.15
@@ -108,7 +108,8 @@
      */
     public void notifySuccess(TrailerWriter tw) {
                ph.registerMessageSent(this, true);
-               Core.logger.log(this, "notifySuccess(" + tw + ") for " + this, 
Logger.DEBUG);
+               boolean logDEBUG = Core.logger.shouldLog(Logger.DEBUG,this);
+               if(logDEBUG) Core.logger.log(this, "notifySuccess(" + tw + ") for " + 
this, Logger.DEBUG);
                if (finished) {
                        Core.logger.log(this, "notifySuccess on " + this +" already 
finished!", new Exception("debug"), Logger.MINOR);
                        return;

Index: OpenConnectionManager.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/OpenConnectionManager.java,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -w -r1.139 -r1.140
--- OpenConnectionManager.java  21 Oct 2003 11:04:52 -0000      1.139
+++ OpenConnectionManager.java  22 Oct 2003 12:32:06 -0000      1.140
@@ -512,7 +512,7 @@
                         connectionJobs.remove(p);
                         ct = null;
                     } else {
-                        Core.logger.log(this, "Got " + ct + ", waiting on it", 
Logger.DEBUG);
+                        if(logDEBUG) Core.logger.log(this, "Got " + ct + ", waiting 
on it", Logger.DEBUG);
                         updatedRefcount = true;
                         ct.incRefcount();
                     }
@@ -523,18 +523,18 @@
                                        ct = new ConnectionJob(c, p);
                                        connectionJobs.put(p, ct);
                                        updatedRefcount = true;
-                                       Core.logger.log(this, "Created new ConnJob: " 
+ ct + " for " + p, Logger.DEBUG);
+                                       if(logDEBUG) Core.logger.log(this, "Created 
new ConnJob: " + ct + " for " + p, Logger.DEBUG);
                                        ct.incRefcount();
                                }
                        }
                        
                        synchronized (ct) {
                                if(timeout == -1 && (!ct.done) && weStarted) {
-                                       Core.logger.log(this, "Starting " + ct + " on 
this thread", Logger.DEBUG);
+                                       if(logDEBUG) Core.logger.log(this, "Starting " 
+ ct + " on this thread", Logger.DEBUG);
                                        ct.run();
                                } else {
                                        if(weStarted) {
-                                               Core.logger.log(this, "Starting " + ct 
+ " on another thread", Logger.DEBUG);
+                                               if(logDEBUG) Core.logger.log(this, 
"Starting " + ct + " on another thread", Logger.DEBUG);
                                                tf.getThread(ct);
                                        }
                                        //tm.forceRun(ct);
@@ -572,7 +572,7 @@
                                                                                
timeout+")", Logger.ERROR);
                                        }
                                        ConnectFailedException e = new 
ConnectFailedException(p.getAddress(), p.getIdentity(), "Timeout reached while 
waiting", true);
-                                       Core.logger.log(this, "Failed to connect on " 
+ ct.ch + " with " + ct, e, Logger.DEBUG);
+                                       if(logDEBUG) Core.logger.log(this, "Failed to 
connect on " + ct.ch + " with " + ct, e, Logger.DEBUG);
                                        throw e;
                                } else {
                                        
Core.diagnostics.occurrenceBinomial("connectionRatio",1,0);

Index: ConnectionHandler.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/ConnectionHandler.java,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -w -r1.193 -r1.194
--- ConnectionHandler.java      21 Oct 2003 23:16:22 -0000      1.193
+++ ConnectionHandler.java      22 Oct 2003 12:32:07 -0000      1.194
@@ -1052,7 +1052,7 @@
                                        sendingTrailerChunkBytes = 0;
                                }
                                if(twcb != null) {
-                                       logDEBUG("Calling "+twcb+".written()");
+                                       if(logDEBUG) logDEBUG("Calling 
"+twcb+".written()");
                                        twcb.written();
                                }
                                if(trailerSentBytes < trailerSendLength)
@@ -1148,7 +1148,7 @@
                synchronized(sentPacketLock) {
                        if(trailerSendID != -1) return;
                        if(sentPacket == null) {
-                               logDEBUG("synchronized...");
+                               if(logDEBUG) logDEBUG("synchronized...");
                                if(sendingCloseMessage) {
                                        Message  cm  = p.getCloseMessage();
                                        if(cm != null) {
@@ -1164,8 +1164,7 @@
                                                                                       
         " in jobDone", Logger.DEBUG);
                                                } catch (IOException e) {
                                                        mySentPacket = sentPacket = 
null;
-                                                       logDEBUG("Caught "+e+
-                                                                        " in 
getPacket (close message) in jobDone");
+                                                       if(logDEBUG) logDEBUG("Caught 
"+e+ " in getPacket (close message) in jobDone");
                                                }
                                        }
                                        sendingCloseMessage = false;
@@ -1178,7 +1177,7 @@
                                                                                       
 " on "+this, Logger.DEBUG);
                                        } catch (IOException e) {
                                                mySentPacket = sentPacket = null;
-                                               logDEBUG("Caught "+e+" in getPacket in 
jobDone");
+                                               if(logDEBUG) logDEBUG("Caught "+e+" in 
getPacket in jobDone");
                                        }
                                }
                        }

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

Reply via email to