Ignore:
Timestamp:
May 26, 2009, 8:03:39 PM (15 years ago)
Author:
Christoph Mayer
Message:

-autolink message buffer von basecomm nach baseoverlay und komplette logik hochgezogen damit mit neuem overlay routing zurecht kommt, damit ist letzer fehler raus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/BaseCommunication.cpp

    r3699 r3712  
    217217        }
    218218
    219         // warn if this link has some queued messages attached
    220         if( descriptor.waitingmsg.size() > 0 ){
    221                 logging_warn( "dropping link " << link.toString() <<
    222                         " that has " << descriptor.waitingmsg.size() << " waiting messages" );
    223         }
    224 
    225219        // create message to drop the link
    226220        logging_debug( "sending out link close request. for us, the link is closed now" );
     
    266260        msg.encapsulate( const_cast<Message*>(message) );
    267261
    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;
    283270}
    284271
     
    466453                }
    467454
    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 
    479455        } // LINK_STATE_OPEN_REPLY
    480456
     
    503479                        i->onLinkDown( linkDesc.localLink, linkDesc.localLocator, linkDesc.remoteLocator );
    504480                }
    505 
    506                 //
    507                 // delete all pending messages for the link that has been closed
    508                 //
    509 
    510                 BOOST_FOREACH( Message* msg, linkDesc.waitingmsg ){
    511                         delete msg;
    512                 }
    513 
    514                 linkDesc.waitingmsg.clear();
    515481
    516482                //
     
    579545                if( (*i).localLink != localLink) continue;
    580546
    581                 BOOST_FOREACH( Message* msg, i->waitingmsg ){
    582                         delete msg;
    583                 }
    584 
    585                 i->waitingmsg.clear();
    586547                linkSet.erase( i );
    587 
    588548                break;
    589549        }
Note: See TracChangeset for help on using the changeset viewer.