Changeset 3712 for source/ariba/communication
- Timestamp:
- May 26, 2009, 8:03:39 PM (16 years ago)
- Location:
- source/ariba/communication
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/BaseCommunication.cpp
r3699 r3712 217 217 } 218 218 219 // warn if this link has some queued messages attached220 if( descriptor.waitingmsg.size() > 0 ){221 logging_warn( "dropping link " << link.toString() <<222 " that has " << descriptor.waitingmsg.size() << " waiting messages" );223 }224 225 219 // create message to drop the link 226 220 logging_debug( "sending out link close request. for us, the link is closed now" ); … … 266 260 msg.encapsulate( const_cast<Message*>(message) ); 267 261 268 if( linkDesc.linkup ){ 269 270 // send message 271 transport->sendMessage( &msg ); 272 return ++currentSeqnum; 273 274 } else { 275 276 // queue message 277 logging_info( "link " << lid.toString() << " is not up yet, queueing message" ); 278 linkDesc.waitingmsg.push_back( new Message(msg) ); // TODO ooooo 279 280 return 0; 281 282 } // if( linkDesc.linkup ) 262 if( !linkDesc.linkup ){ 263 logging_error("cant send message on link " << lid.toString() << ", link not up"); 264 return -1; 265 } 266 267 // send message 268 transport->sendMessage( &msg ); 269 return ++currentSeqnum; 283 270 } 284 271 … … 466 453 } 467 454 468 if( linkDesc.waitingmsg.size() > 0 ){469 logging_info( "sending out queued messages on link " << linkDesc.localLink.toString() );470 471 BOOST_FOREACH( Message* msg, linkDesc.waitingmsg ){472 sendMessage( linkDesc.localLink, msg );473 delete msg;474 }475 476 linkDesc.waitingmsg.clear();477 }478 479 455 } // LINK_STATE_OPEN_REPLY 480 456 … … 503 479 i->onLinkDown( linkDesc.localLink, linkDesc.localLocator, linkDesc.remoteLocator ); 504 480 } 505 506 //507 // delete all pending messages for the link that has been closed508 //509 510 BOOST_FOREACH( Message* msg, linkDesc.waitingmsg ){511 delete msg;512 }513 514 linkDesc.waitingmsg.clear();515 481 516 482 // … … 579 545 if( (*i).localLink != localLink) continue; 580 546 581 BOOST_FOREACH( Message* msg, i->waitingmsg ){582 delete msg;583 }584 585 i->waitingmsg.clear();586 547 linkSet.erase( i ); 587 588 548 break; 589 549 } -
source/ariba/communication/BaseCommunication.h
r3690 r3712 46 46 #include <vector> 47 47 #include <iostream> 48 #include <deque>49 48 #include <algorithm> 50 49 #include <boost/foreach.hpp> … … 78 77 using std::map; 79 78 using std::vector; 80 using std::deque;81 79 using std::pair; 82 80 using std::make_pair; … … 256 254 remoteEndpoint(desc.remoteEndpoint), 257 255 linkup(desc.linkup) { 258 259 BOOST_FOREACH( Message* msg, desc.waitingmsg ){260 waitingmsg.push_back( msg );261 }262 256 } 263 257 … … 266 260 } 267 261 268 LinkID localLink;262 LinkID localLink; 269 263 const NetworkLocator* localLocator; 270 LinkID remoteLink;264 LinkID remoteLink; 271 265 const NetworkLocator* remoteLocator; 272 EndpointDescriptor remoteEndpoint; 273 274 bool linkup; 275 deque<Message*> waitingmsg; 266 EndpointDescriptor remoteEndpoint; 267 268 bool linkup; 276 269 }; 277 270
Note:
See TracChangeset
for help on using the changeset viewer.