Author: toad
Date: 2008-01-22 23:54:40 +0000 (Tue, 22 Jan 2008)
New Revision: 17202

Modified:
   trunk/freenet/src/freenet/node/RequestHandler.java
Log:
Fix leak (not unregistering) of SSKs when found local data but the client node 
doesn't need the public key to be transferred.

Modified: trunk/freenet/src/freenet/node/RequestHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/RequestHandler.java  2008-01-22 22:58:18 UTC 
(rev 17201)
+++ trunk/freenet/src/freenet/node/RequestHandler.java  2008-01-22 23:54:40 UTC 
(rev 17202)
@@ -334,13 +334,15 @@
      */
     private void returnLocalData(KeyBlock block) throws NotConnectedException {
         Message df = createDataFound(block);
-        source.sendAsync(df, null, 0, this);
         if(key instanceof NodeSSK) {
             if(needsPubKey) {
+               source.sendAsync(df, null, 0, this);
                DSAPublicKey key = ((NodeSSK)block.getKey()).getPubKey();
                Message pk = DMT.createFNPSSKPubKey(uid, key);
                if(logMINOR) Logger.minor(this, "Sending PK: "+key+ ' ' 
+key.toLongString());
                sendTerminal(pk);
+            } else {
+               sendTerminal(df);
             }
             status = RequestSender.SUCCESS; // for byte logging
         }


Reply via email to