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

Location:
source/ariba/communication
Files:
2 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        }
  • source/ariba/communication/BaseCommunication.h

    r3690 r3712  
    4646#include <vector>
    4747#include <iostream>
    48 #include <deque>
    4948#include <algorithm>
    5049#include <boost/foreach.hpp>
     
    7877using std::map;
    7978using std::vector;
    80 using std::deque;
    8179using std::pair;
    8280using std::make_pair;
     
    256254                        remoteEndpoint(desc.remoteEndpoint),
    257255                        linkup(desc.linkup) {
    258 
    259                         BOOST_FOREACH( Message* msg, desc.waitingmsg ){
    260                                 waitingmsg.push_back( msg );
    261                         }
    262256                }
    263257
     
    266260                }
    267261
    268                 LinkID                  localLink;
     262                LinkID                                  localLink;
    269263                const NetworkLocator*   localLocator;
    270                 LinkID                  remoteLink;
     264                LinkID                                  remoteLink;
    271265                const NetworkLocator*   remoteLocator;
    272                 EndpointDescriptor      remoteEndpoint;
    273 
    274                 bool                    linkup;
    275                 deque<Message*>         waitingmsg;
     266                EndpointDescriptor              remoteEndpoint;
     267
     268                bool                                    linkup;
    276269        };
    277270
Note: See TracChangeset for help on using the changeset viewer.