[My previous message was temporarily rejected by emu due to greylisting 
(OK), but the backup MX rejected it outright (not ok)]

getLocalNoderef() factored out in r17204.


> A seed node should also get a differential noderef, being the opennet noderef

By this do you mean that the local opennet noderef should be sent to a 
SeedClientPeerNode, a SeedServerPeerNode or both?  Any suggestions on 
how to check in getLocalNoderef() for the type I am and thus return the 
opennet ref for or should I make isSeedClient() and/or isSeedServer()?


Matthew Toseland wrote:
> On Sunday 20 January 2008 16:01, zothar at freenetproject.org wrote:
>   
>> Author: zothar
>> Date: 2008-01-20 16:01:53 +0000 (Sun, 20 Jan 2008)
>> New Revision: 17170
>>
>> Modified:
>>    trunk/freenet/src/freenet/node/PeerNode.java
>> Log:
>> Add code, not wired in yet, to send a differential node reference containing 
>>     
> node reference fields not required for handshake.  Once wired in, this should 
> later allow removing those fields from the handshake exchanged node 
> references.
>   
>> Modified: trunk/freenet/src/freenet/node/PeerNode.java
>> ===================================================================
>> --- trunk/freenet/src/freenet/node/PeerNode.java     2008-01-19 23:44:16 UTC 
>>     
> (rev 17169)
>   
>> +++ trunk/freenet/src/freenet/node/PeerNode.java     2008-01-20 16:01:53 UTC 
>>     
> (rev 17170)
>   
>> @@ -3472,9 +3472,48 @@
>>      }
>>  
>>      /**
>> -     * A method to be to queue an N2NM in a extra peer data file, only 
>>     
> implemented by DarknetPeerNode
>   
>> +     * A method to queue an N2NM in a extra peer data file, only 
>> implemented 
>>     
> by DarknetPeerNode
>   
>>       */
>>      public void queueN2NM(SimpleFieldSet fs) {
>>              // Do nothing in the default impl
>>      }
>> +
>> +    /**
>> +     * A method to be called after completing a handshake to send the
>> +     * newly connected peer, as a differential node reference, the
>> +     * parts of our node reference not needed for handshake.
>> +     * Should only be called by completedHandshake() after we're happy
>> +     * with the connection
>> +     */
>> +    private void sendConnectedDiffNoderef() {
>> +            SimpleFieldSet fs = new SimpleFieldSet(true);
>> +            SimpleFieldSet nfs = null;
>> +            if(isDarknet()) {
>> +                    node.exportDarknetPublicFieldSet();
>> +            } else if(isOpennet()) {
>> +                    node.exportOpennetPublicFieldSet();
>> +            } else {
>> +                    // What else is there that a differential node 
>> reference would care 
>>     
> about?  Add it here if needed
>   
>> +                    return;
>> +            }
>>     
>
> A seed node should also get a differential noderef, being the opennet 
> noderef. 
> Maybe you should factor this out into getLocalNoderef() or something ?
>
>   
>> +            if(null != nfs.get("ark.pubURI")) {
>> +                    fs.putOverwrite("ark.pubURI", nfs.get("ark.pubURI"));
>> +            }
>> +            if(null != nfs.get("ark.number")) {
>> +                    fs.putOverwrite("ark.number", nfs.get("ark.number"));
>> +            }
>> +            if(isDarknet() && null != nfs.get("myName")) {
>> +                    fs.putOverwrite("myName", nfs.get("myName"));
>> +            }
>> +            String[] physicalUDPEntries = nfs.getAll("physical.udp");
>> +            if(physicalUDPEntries != null) {
>> +                    fs.putOverwrite("physical.udp", physicalUDPEntries);
>> +            }
>> +            if(!fs.isEmpty()) {
>> +                    if(logMINOR) Logger.minor(this, "fs is '" + 
>> fs.toString() + "'");
>> +                    sendNodeToNodeMessage(fs, 
>> Node.N2N_MESSAGE_TYPE_DIFFNODEREF, false, 0, 
>>     
> false);
>   
>> +            } else {
>> +                    if(logMINOR) Logger.minor(this, "fs is empty");
>> +            }
>> +    }
>>  }
>>     
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Devl mailing list
>> Devl at freenetproject.org
>> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl



Reply via email to