Author: toad
Date: 2008-02-02 16:47:29 +0000 (Sat, 02 Feb 2008)
New Revision: 17477

Modified:
   trunk/freenet/src/freenet/node/NodeDispatcher.java
Log:
Start to wire in FNPOfferKey

Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeDispatcher.java  2008-02-02 16:47:09 UTC 
(rev 17476)
+++ trunk/freenet/src/freenet/node/NodeDispatcher.java  2008-02-02 16:47:29 UTC 
(rev 17477)
@@ -6,12 +6,15 @@
 import java.util.HashSet;
 import java.util.Hashtable;

+import freenet.crypt.HMAC;
+import freenet.crypt.SHA256;
 import freenet.io.comm.DMT;
 import freenet.io.comm.Dispatcher;
 import freenet.io.comm.Message;
 import freenet.io.comm.MessageType;
 import freenet.io.comm.NotConnectedException;
 import freenet.io.comm.Peer;
+import freenet.keys.Key;
 import freenet.support.Fields;
 import freenet.support.Logger;
 import freenet.support.ShortBuffer;
@@ -155,10 +158,19 @@
 //                     return handleProbeRejected(m, source);
 //             } else if(spec == DMT.FNPProbeTrace) {
 //                     return handleProbeTrace(m, source);
+               } else if(spec == DMT.FNPOfferKey) {
+                       return handleOfferKey(m, source);
                } 
                return false;
        }

+       private boolean handleOfferKey(Message m, PeerNode source) {
+               Key key = (Key) m.getObject(DMT.KEY);
+               byte[] authenticator = ((ShortBuffer) 
m.getObject(DMT.OFFER_AUTHENTICATOR)).getData();
+               node.failureTable.onOffer(key, source, authenticator);
+               return true;
+       }
+
        private void handleDisconnect(final Message m, final PeerNode source) {
                // Must run ON the packet sender thread as it sends a packet 
directly
                node.getTicker().queueTimedJob(new FastRunnable() {


Reply via email to