Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9511 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 27, 2006, 4:05:39 PM (18 years ago)
Author:
patrick
Message:

produced segfault by double sending messages. fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/message_manager.cc

    r9510 r9511  
    327327  for ( MessageQueue::iterator it = this->outgoingMessageQueue.begin(); it != this->outgoingMessageQueue.end(); it++ )
    328328  {
     329
     330        // relay server special handling
     331    if( SharedNetworkData::getInstance()->isMasterServer() && SharedNetworkData::getInstance()->isUserProxyServerActive(it->first))
     332    {
     333      NetworkMessage msg;
     334
     335      msg.data = new byte[dataLength];
     336      memcpy( msg.data, data, dataLength );
     337      msg.length = dataLength;
     338      msg.messageType = messageType;
     339      msg.number = this->newNumber++;
     340      msg.priority = messagePriority;
     341
     342      it->second.messages.push_back( msg );
     343    }
    329344    // check for every node if the message is for it also
    330     if (
     345    else if (
    331346         recieverType == RT_ALL_ME ||
    332347         recieverType == RT_ALL_BUT_ME ||
     
    349364    }
    350365
    351     // relay server special handling
    352     if( SharedNetworkData::getInstance()->isMasterServer() && SharedNetworkData::getInstance()->isUserProxyServerActive(it->first))
    353     {
    354       NetworkMessage msg;
    355 
    356       msg.data = new byte[dataLength];
    357       memcpy( msg.data, data, dataLength );
    358       msg.length = dataLength;
    359       msg.messageType = messageType;
    360       msg.number = this->newNumber++;
    361       msg.priority = messagePriority;
    362 
    363       it->second.messages.push_back( msg );
    364     }
     366
    365367  }
    366368
Note: See TracChangeset for help on using the changeset viewer.