Changeset 12774


Ignore:
Timestamp:
Mar 26, 2014, 6:44:32 PM (10 years ago)
Author:
hock@…
Message:

StreamTransport bug fixed!!

[ Back to normal. :-) ]

Location:
source/ariba/utility/transport
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/transport/StreamTransport/StreamTransport.cpp

    r12773 r12774  
    366366        parent(parent),
    367367        out_queues(8), //TODO How much priorities shall we have?
    368         sending(false),
    369         MAGIC_NUMBER(424242)
     368        sending(false)
    370369{
    371370        header.length = 0;
     
    595594    bool restart_sending = false;
    596595   
    597         // FIXME Mario DEBUGGING  --  copy !!
    598         reboost::shared_buffer_t buff = packet.linearize();
    599         reboost::message_t msg;
    600         msg.push_back(buff);
    601         assert ( msg.MAGIC_NUMBER == 421337 );
    602         // [ DEBUGGING ]
     596        // debugging --> copy message (instead of zero copy)
     597//      reboost::shared_buffer_t buff = packet.linearize();
     598//      reboost::message_t msg;
     599//      msg.push_back(buff);
     600//      assert ( msg.MAGIC_NUMBER == 421337 );
     601        // [ debugging ]
    603602       
    604603       
    605604    // enqueue packet  [locked]
    606605    {
    607         boost::mutex::scoped_lock lock(out_queues_lock);
    608                
    609                 int debuggingA = out_queues[priority].size();
    610 //              assert ( debuggingA < 1000 ); // XXX
     606        unique_lock lock(out_queues_lock);
    611607               
    612608                assert ( this->valid );
    613        
    614         assert( priority < out_queues.size() );  // NOTE: actual assert, not in context with the extended debugging..
    615 //         out_queues[priority].push(packet);  // FIXME Mario
    616                 out_queues[priority].push(msg);            // FIXME Mario
    617                
    618                 // XXX
    619                 int debuggingB = out_queues[priority].size();
    620                 int magic = out_queues[priority].back().MAGIC_NUMBER;
    621                 assert ( debuggingB == debuggingA + 1 );
    622                 assert ( magic == 421337 );
    623        
     609        assert( priority < out_queues.size() );
     610
     611                // * enqueue *
     612                out_queues[priority].push(packet);
     613                       
    624614        if ( ! sending )
    625615        {
     
    643633    bool found = false;
    644634
    645         // XXX Mario: Debugging
     635        // I'm not sure if this can actually happen.. But let's be on the save side, here.
    646636        if ( ! this->valid )
    647637        {
    648638                this->sending = false;
    649                 cout << "/// StreamConnection::send_next_package() on INVALID STREAM" << endl;
    650639                return;
    651640        }
     
    653642    // find packet with highest priority  [locked]
    654643    {
    655         boost::mutex::scoped_lock lock(out_queues_lock);
     644        unique_lock lock(out_queues_lock);
    656645               
    657                 assert ( this->valid ); // XXX TODO ggf. in if (valid) Àndern...
    658                 assert ( this->sending );
    659                 assert ( this->MAGIC_NUMBER == 424242 );
    660                 assert ( this->out_queues.size() == 8 );
    661        
    662646        for ( vector<OutQueue>::iterator it = out_queues.begin();
    663647                it != out_queues.end(); it++ )
    664648        {
    665                         int debugging = it->size();  // XXX debugging
    666 //                      assert ( debugging < 1000 );
    667                        
    668649            if ( !it->empty() )
    669650            {
  • source/ariba/utility/transport/StreamTransport/StreamTransport.hpp

    r12773 r12774  
    6666        virtual ~StreamConnection()
    6767                {
    68                         // XXX MARIO Debugging
    69                         std::cout << "/// ~StreamConnection(): " << this << ", SENDING: " << this->sending << ", VALID: " << this->valid << std::endl;
    70                        
    7168                        assert ( this->valid == false );
    7269                }
     
    133130        shared_buffer_t buffy;
    134131       
    135                
    136                 // XXX Mario: Debugging
    137                 const int MAGIC_NUMBER;
    138132    private:
    139133        std::vector<ariba::utility::LinkID*> communication_links;
  • source/ariba/utility/transport/messages/message.hpp

    r12773 r12774  
    6969        /// Create a new message
    7070        inline message_t() :
    71                 imsg(),
    72                 MAGIC_IDENTIFIER("!!message_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging
    73                 MAGIC_NUMBER(421337) // XXX Mario: Debugging
     71                imsg()
    7472        {
    7573        }
     
    7775        /// Copy message
    7876        inline message_t(const message_t& msg) :
    79                 imsg(msg.imsg),
    80                 MAGIC_IDENTIFIER(msg.MAGIC_IDENTIFIER),  // XXX
    81                 MAGIC_NUMBER(msg.MAGIC_NUMBER) // XXX
     77                imsg(msg.imsg)
    8278
    8379        {
    84                 assert ( msg.MAGIC_NUMBER == 421337 ); // XXX
    85                
    8680            if ( imsg )
    8781                imsg->owner = NULL;
     
    9690        inline message_t& operator=(const message_t& msg)
    9791        {
    98                 assert ( msg.MAGIC_NUMBER == 421337 ); // XXX
    99                
    10092                if ( msg.imsg )
    10193                {
     
    10597                else
    10698                {
    107                         // TODO: is this a valid state? (since it can definitely been reached...)
    10899                        imsg.reset();
    109100                }
     
    274265                mlength_t index, length;
    275266               
    276                 // XXX Mario: Debugging
    277                 const std::string MAGIC_IDENTIFIER;
    278                 const int MAGIC_NUMBER;
    279267        public:
    280268                inline imsg_t() :
    281269                        owner(NULL),
    282270                        index(0),
    283                         length(0),
    284                         MAGIC_IDENTIFIER("!!imsg_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging
    285                         MAGIC_NUMBER(133742)
     271                        length(0)
    286272                {
    287273                }
    288274                inline imsg_t(const imsg_t& imsg) :
    289                         index(imsg.index), length(imsg.length),
    290                         MAGIC_IDENTIFIER(imsg.MAGIC_IDENTIFIER),  // XXX
    291                         MAGIC_NUMBER(imsg.MAGIC_NUMBER) // XXX
     275                        index(imsg.index), length(imsg.length)
    292276                {
    293277                        for (mlength_t i = 0; i < length; i++)
     
    359343                        length--;
    360344                }
    361         };
     345        }; // [ class imsg_t ] -- inner class
     346       
    362347        /// own a new message
    363348        inline imsg_t& own() {
     
    368353                return *imsg;
    369354        }
    370         boost::shared_ptr<imsg_t> imsg;
    371        
    372         // XXX Mario: Debugging
    373 public:
    374         const std::string MAGIC_IDENTIFIER;
    375         const int MAGIC_NUMBER;
    376 };
     355        boost::shared_ptr<imsg_t> imsg;
     356}; // [ class message_t ] -- outer class
    377357
    378358inline message_t operator+(const message_t& lhs, const message_t& rhs) {
Note: See TracChangeset for help on using the changeset viewer.