Fix bug only half of unreliable queue handled per step in worst case 1120/head
authorsapier <Sapier at GMX dot net>
Sun, 26 Jan 2014 15:59:36 +0000 (16:59 +0100)
committersapier <Sapier at GMX dot net>
Sun, 26 Jan 2014 16:40:59 +0000 (17:40 +0100)
src/connection.cpp

index 9f167266c2e26dee66d64f6e91eeda55c1fe441f..2e126a770c6f85084826f112fd71e38dda895f6e 100644 (file)
@@ -1843,8 +1843,9 @@ void ConnectionSendThread::sendPackets(float dtime)
                                << m_outgoing_queue.size() << " pkts)" << std::endl);
        }
 
+       unsigned int initial_queuesize = m_outgoing_queue.size();
        /* send non reliable packets*/
-       for(unsigned int i=0;i < m_outgoing_queue.size();i++) {
+       for(unsigned int i=0;i < initial_queuesize;i++) {
                OutgoingPacket packet = m_outgoing_queue.pop_front();
 
                assert(!packet.reliable &&