Changeset 5883
- Timestamp:
- Aug 12, 2009, 2:26:32 PM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5882 r5883 360 360 if (ld==NULL 361 361 || !ld->up 362 || ld->keepAliveMissed != 0 363 || !ld->communicationUp 362 364 || difftime(route.used, time(NULL)) > 4) { 363 365 logging_info("Forgetting relay information to node " … … 398 400 LinkID next_link = overlayInterface->getNextLinkId(message->getSourceNode()); 399 401 if (next_link == ld->overlayId) return; 400 ld->setRelaying();401 402 402 403 // try to find source node … … 437 438 if (route.node == remote ) { 438 439 LinkDescriptor* ld = getDescriptor( route.link ); 439 if (ld==NULL || !ld->up) return NULL; else return ld; 440 if (ld==NULL || !ld->up) return NULL; else { 441 route.used = time(NULL); 442 return ld; 443 } 440 444 } 441 445 } -
source/ariba/overlay/modules/chord/Chord.cpp
r5882 r5883 113 113 if ( remote == nodeid || link.isUnspecified()) return; 114 114 if ( table->size() == 0 ) return; 115 ttl = 2; 115 116 116 117 OverlayMsg msg( typeDiscovery ); 117 118 msg.setRelayed(true); 118 Discovery dmsg( Discovery::normal, (uint8_t) 2, baseoverlay.getEndpointDescriptor() );119 Discovery dmsg( Discovery::normal, (uint8_t)ttl, baseoverlay.getEndpointDescriptor() ); 119 120 msg.encapsulate(&dmsg); 120 121 … … 124 125 125 126 void Chord::discover_neighbors( const LinkID& link ) { 126 uint8_t ttl = 2;127 uint8_t ttl = 1; 127 128 { 128 129 // send predecessor discovery … … 419 420 420 421 // updating neighbors 422 logging_debug("Discover new ring neighbors"); 421 423 for (int i=0; i<table->size(); i++) { 422 424 LinkID id = (*table)[i]->info; … … 427 429 logging_debug("Sending discovery message to my neighbors and fingers"); 428 430 stabilize_finger = ((stabilize_finger+1) % table->get_finger_table_size() ); 429 const NodeID disc1 = nodeid; 430 const NodeID disc2 = table->get_finger_table(stabilize_finger).get_compare().get_center(); 431 send_discovery_to(disc1); 432 if (disc1 != disc2) 433 send_discovery_to(disc2); 434 431 const NodeID disc = table->get_finger_table(stabilize_finger).get_compare().get_center(); 432 if (disc != nodeid) 433 send_discovery_to(disc); 435 434 436 435 // remove orphan links
Note:
See TracChangeset
for help on using the changeset viewer.