Changeset 5884
- Timestamp:
- Aug 12, 2009, 2:52:12 PM (15 years ago)
- Location:
- source/ariba/overlay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5883 r5884 141 141 time_t now = time(NULL); 142 142 BOOST_FOREACH( LinkDescriptor* ld, links ) { 143 // remote used as relay flag144 if ( ld->relaying && difftime( now, ld->timeRelaying ) > 10)145 ld->relaying = false;146 143 147 144 // keep alives and not up? yes-> link connection request is stale! … … 160 157 161 158 if (!ld->up) continue; 159 160 // remote used as relay flag 161 if ( ld->relaying && difftime( now, ld->timeRelaying ) > 10) 162 ld->relaying = false; 162 163 163 164 // drop links that are dropped and not used as relay … … 240 241 } else { 241 242 // destinastion myself? yes-> handle message 242 if (message->getDestinationNode() == nodeId) 243 handleMessage( message, NULL ); 244 else 243 if (message->getDestinationNode() == nodeId) { 244 logging_warn("Usually I should not route messages to myself!"); 245 Message msg; 246 msg.encapsulate(message); 247 handleMessage( &msg, NULL ); 248 } else { 245 249 // no->send message to next hop 246 250 send( message, message->getDestinationNode() ); 251 } 247 252 } 248 253 } … … 331 336 const ServiceID& service) { 332 337 message->setSourceNode(nodeId); 338 message->setDestinationNode(remote); 333 339 message->setService(service); 334 message->setDestinationNode(remote);335 340 send( message, remote ); 336 341 } … … 343 348 } 344 349 message->setSourceNode(nodeId); 350 message->setDestinationNode(ld->remoteNode); 351 345 352 message->setSourceLink(ld->overlayId); 353 message->setDestinationLink(ld->remoteLink); 354 346 355 message->setService(ld->service); 347 message->setDestinationNode(ld->remoteNode);348 message->setDestinationLink(ld->remoteLink);349 356 return send( message, ld, ignore_down ); 350 357 } … … 1476 1483 if( overlayMsg == NULL ) return false; 1477 1484 1485 // increase number of hops 1486 overlayMsg->increaseNumHops(); 1487 1478 1488 // refresh relay information 1479 1489 refreshRelayInformation( overlayMsg, ld ); 1480 1481 // increase number of hops1482 overlayMsg->increaseNumHops();1483 1490 1484 1491 // update route record … … 1500 1507 << " to " << overlayMsg->getDestinationNode() 1501 1508 ); 1502 1503 1509 route( overlayMsg ); 1504 1510 delete overlayMsg; -
source/ariba/overlay/modules/chord/Chord.cpp
r5883 r5884 249 249 baseoverlay.dropLink(item->info); 250 250 item->info = lnk; 251 251 252 // discover neighbors of new overlay neighbor 252 discover_neighbors( lnk );253 253 showLinks(); 254 254 } else { // no-> add orphan entry to routing table 255 255 logging_info("new orphan: " << remote.toString() 256 256 << " with link " << lnk.toString()); 257 table->insert_orphan(remote)->info = lnk; 257 item = table->insert_orphan(remote); 258 259 // replace with new link 260 if (!item->info.isUnspecified() || item->info!=lnk) 261 baseoverlay.dropLink(item->info); 262 item->info = lnk; 258 263 } 259 264 … … 373 378 item = table->get(*table->get_predesessor()); 374 379 } 375 if (item == NULL) break; 380 if (item == NULL) 381 break; 382 376 383 logging_debug("Routing discovery message to succ/pred " 377 384 << item->id.toString() );
Note:
See TracChangeset
for help on using the changeset viewer.