Changeset 5642


Ignore:
Timestamp:
Aug 4, 2009, 10:47:35 AM (15 years ago)
Author:
mies
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/chord/Chord.cpp

    r5637 r5642  
    7171/// helper: sets up a link using the base overlay
    7272LinkID Chord::setup(const EndpointDescriptor& endp, const NodeID& node) {
    73 
    74         logging_debug("request to setup link to " << endp.toString() );
    75 
     73        logging_debug("Request to setup link to " << endp.toString() );
     74
     75        // check if node is already present
     76        if (!node.isUnspecified() && table->get(node)!=NULL) {
     77                logging_error("Node is already a neighbor!");
     78                return LinkID::UNSPECIFIED;
     79        }
     80
     81        // check if we are already trying to establish a link
    7682        for (size_t i=0; i<pending.size(); i++)
    77                 if (pending[i]==node) return LinkID::UNSPECIFIED;
    78         pending.push_back(node);
     83                if ( pending[i] == node ) {
     84                        logging_debug("Already trying to establish a link to node " << node.toString() );
     85                        return LinkID::UNSPECIFIED;
     86                }
     87
     88        // adding node to list of pending connections
     89        pending.push_back( node );
    7990
    8091        // establish link via base overlay
Note: See TracChangeset for help on using the changeset viewer.