Update of /cvsroot/freenet/freenet/src/freenet/node/states/request
In directory sc8-pr-cvs1:/tmp/cvs-serv28452/src/freenet/node/states/request

Modified Files:
      Tag: ngrouting
        Pending.java 
Log Message:
logging, fix NPE, fix deeper issue (premature termination again of course)


Index: Pending.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/node/states/request/Pending.java,v
retrieving revision 1.47.2.10
retrieving revision 1.47.2.11
diff -u -r1.47.2.10 -r1.47.2.11
--- Pending.java        29 Aug 2003 18:58:06 -0000      1.47.2.10
+++ Pending.java        29 Aug 2003 22:43:39 -0000      1.47.2.11
@@ -482,7 +482,11 @@
            if(logDEBUG)
                n.logger.log(this, "Still trying to route "+searchKey+"("+
                             this+"), attempt "+attemptCount, Logger.DEBUG);
-            nr = routes.getNextRoute();
+           if(routes == null) {
+               nr = null; // terminated
+               n.logger.log(this, "Already terminated but trying to route!: "+this,
+                            Logger.NORMAL);
+           } else nr = routes.getNextRoute();
            if(logDEBUG) n.logger.log(this, "Got next route for "+this,
                                      Logger.DEBUG);
            long stillInSendOnTime = System.currentTimeMillis();
@@ -649,7 +653,6 @@
                    n.logger.log(this, "Trying to fetch "+this
                                 +" at "+startTime, Core.logger.DEBUG);
                doc = n.ds.getData(searchKey);
-               terminateRouting(true, false);
                long gotDataTime = System.currentTimeMillis();
                if(logDEBUG)
                    n.logger.log(this, "getData took "+(gotDataTime-startTime)+
@@ -658,6 +661,7 @@
                    doc.setParent(id, n.ticker().getMessageHandler(),
                                  "Replying with data from store");
                    sendingData = sendData(n, doc);
+                   terminateRouting(true, false);
                    long sendingDataTime = System.currentTimeMillis();
                    if(logDEBUG)
                        n.logger.log(this, "sendData() took "+

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

Reply via email to