Author: toad
Date: 2008-01-31 20:13:24 +0000 (Thu, 31 Jan 2008)
New Revision: 17440

Modified:
   trunk/freenet/src/freenet/node/NodeDispatcher.java
   trunk/freenet/src/freenet/node/ResettingHTLProbeRequestHandler.java
   trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
Log:
Send the sub-message on relayed RejectedOverload's

Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeDispatcher.java  2008-01-31 20:02:17 UTC 
(rev 17439)
+++ trunk/freenet/src/freenet/node/NodeDispatcher.java  2008-01-31 20:13:24 UTC 
(rev 17440)
@@ -596,7 +596,7 @@
                                        cb.onCompleted("rnf", target, best, 
nearest, uid, counter, uniqueCounter, linearCounter);                           
            
                                }

-                               public void onReceivedRejectOverload() throws 
NotConnectedException {
+                               public void onReceivedRejectOverload(double 
nearest, double best, short counter, short uniqueCounter, short linearCounter, 
String reason) throws NotConnectedException {
                                        cb.onRejectOverload();
                                }


Modified: trunk/freenet/src/freenet/node/ResettingHTLProbeRequestHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/ResettingHTLProbeRequestHandler.java 
2008-01-31 20:02:17 UTC (rev 17439)
+++ trunk/freenet/src/freenet/node/ResettingHTLProbeRequestHandler.java 
2008-01-31 20:13:24 UTC (rev 17440)
@@ -70,8 +70,11 @@
                source.sendAsync(rnf, null, 0, sender);
        }

-       public void onReceivedRejectOverload() throws NotConnectedException {
-               source.sendAsync(DMT.createFNPRejectedOverload(uid, false), 
null, 0, sender);
+       public void onReceivedRejectOverload(double nearest, double best, short 
counter, short uniqueCounter, short linearCounter, String reason) throws 
NotConnectedException {
+               Message ro = DMT.createFNPRejectedOverload(uid, false);
+               Message sub = DMT.createFNPRHReturnSubMessage(nearest, best, 
counter, uniqueCounter, linearCounter, reason);
+               ro.addSubMessage(sub);
+               source.sendAsync(ro, null, 0, sender);
        }

        public void onTimeout(double nearest, double best, short counter, short 
uniqueCounter, short linearCounter, String reason) throws NotConnectedException 
{

Modified: trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java
===================================================================
--- trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java  
2008-01-31 20:02:17 UTC (rev 17439)
+++ trunk/freenet/src/freenet/node/ResettingHTLProbeRequestSender.java  
2008-01-31 20:13:24 UTC (rev 17440)
@@ -382,7 +382,7 @@
                        hasForwardedRejectedOverload = true;
                        notifyAll();
                }
-               fireReceivedRejectOverload();
+               fireReceivedRejectOverload(nearestLoc, best, counter, 
uniqueCounter, linearCounter, "");
        }

     // these are bit-masks
@@ -441,7 +441,7 @@
        interface Listener {
                /** Should return quickly, allocate a thread if it needs to 
block etc 
                 * @throws NotConnectedException */
-               void onReceivedRejectOverload() throws NotConnectedException;
+               void onReceivedRejectOverload(double nearest, double best, 
short counter, short uniqueCounter, short linearCounter, String reason) throws 
NotConnectedException;
                void onTrace(long uid, double nearest, double best, short htl, 
short counter, short uniqueCounter, double location, long myUID, ShortBuffer 
peerLocs, ShortBuffer peerUIDs, short s, short linearCounter, String reason, 
long prevUID) throws NotConnectedException;
                /** On completion 
                 * @throws NotConnectedException */
@@ -464,13 +464,13 @@
                }
        }

-       private void fireReceivedRejectOverload() {
+       private void fireReceivedRejectOverload(double nearest, double best, 
short counter, short uniqueCounter, short linearCounter, String reason) {
                synchronized (listeners) {
                        Iterator i=listeners.iterator();
                        while (i.hasNext()) {
                                Listener l=(Listener)i.next();
                                try {
-                                       l.onReceivedRejectOverload();
+                                       l.onReceivedRejectOverload(nearest, 
best, counter, uniqueCounter, linearCounter, reason);
                                } catch (Throwable t) {
                                        Logger.error(this, "Caught: "+t, t);
                                }


Reply via email to