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

Added Files:
        NewIdentify.java 
Log Message:
d'oh 6278


--- NEW FILE: NewIdentify.java ---
package freenet.node.states.FNP;
import freenet.node.*;
import freenet.support.Logger;
import freenet.message.Identify;
import java.io.InputStream;
import java.io.IOException;
/**
 * Handles Identify messages, verifies noderef contained and sets ref on PeerHandler
 */

public class NewIdentify extends State {
    
    public NewIdentify(long id) {
        super(id);
    }
    
    public String getName() {
        return "New Identify message";
    }
    
    public State receivedMessage(Node n, Identify msg) {
        NodeReference origRef = msg.getSource();
        if(n.rt.wantUnkeyedReference(origRef) &&
           !origRef.isSigned()) {
            try {
                origRef = msg.getVerifiedSource();
            } catch (BadReferenceException e) {
                if(n.logger.shouldLog(Logger.MINOR, this))
                    n.logger.log(this, "Caught "+e+" verifying "+msg, e,
                                 Logger.MINOR);
            }
        }
        n.rt.updateReference(origRef);
        n.connections.updateReference(origRef);
        return null;
    }
    
    public void lost(Node n) {
        n.logger.log(this, "Lost a NewIdentify! "+this,
                     Logger.NORMAL);
    }
}
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to