Changeset 2803 for source/ariba/overlay


Ignore:
Timestamp:
Apr 16, 2009, 10:45:03 AM (16 years ago)
Author:
Christoph Mayer
Message:

-drop all auto-links when leaving the spovnet

Location:
source/ariba/overlay
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/BaseOverlay.cpp

    r2483 r2803  
    108108        logging_info( "leaving spovnet " << spovnetId );
    109109
     110        logging_debug( "dropping all auto-links ..." );
     111       
     112        BOOST_FOREACH( LinkPair item, linkMapping ){
     113                if( item.second.autolink )
     114                        dropLink( item.first );
     115        }
     116
     117        logging_debug( "leaving overlay" );
    110118        // first, leave the overlay interface
    111119        overlayInterface->leaveOverlay();
     
    880888        // drop links after a timeout of 30s
    881889
    882         // the macro gets confused if type is passed directly
    883         // because of the comma in the pair definition
    884         typedef pair<LinkID,LinkItem> pairitem;
    885 
    886         BOOST_FOREACH( pairitem item, linkMapping ){
     890        BOOST_FOREACH( LinkPair item, linkMapping ){
    887891                if( item.second.autolink && difftime(now, item.second.lastuse) > 30)
    888892                        oldlinks.push_back( item.first );
     
    890894
    891895        BOOST_FOREACH( const LinkID lnk, oldlinks ){
     896                logging_debug( "auto-link " << lnk.toString() << " timed out and is getting dropped" );
    892897                dropLink( lnk );
    893898        }
  • source/ariba/overlay/BaseOverlay.h

    r2483 r2803  
    348348
    349349        typedef map<const LinkID, LinkItem> LinkMapping;
     350        typedef pair<const LinkID,LinkItem> LinkPair;
    350351        LinkMapping linkMapping;
    351 
     352       
    352353        // nodes with pending joines. TODO: should be cleaned every some seconds
    353354        // add timestamps to each, and check on occasion
Note: See TracChangeset for help on using the changeset viewer.