Changeset 3751

Show
Ignore:
Timestamp:
08/25/08 16:42:22 (3 months ago)
Author:
andar
Message:

lt sync 2630

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0.0_RC/libtorrent/src/identify_client.cpp

    r3740 r3751  
    379379                for (peer_id::const_iterator i = p.begin(); i != p.end(); ++i) 
    380380                { 
    381                         unknown += isprint(*i)?*i:'.'; 
     381                        unknown += isprint(char(*i))?*i:'.'; 
    382382                } 
    383383                unknown += "]"; 
  • branches/1.0.0_RC/libtorrent/src/peer_connection.cpp

    r3740 r3751  
    15821582                } 
    15831583 
    1584                 for (std::deque<pending_block>::iterator i = m_download_queue.begin(); 
    1585                         i != b;) 
    1586                 { 
     1584                int block_index = b - m_download_queue.begin(); 
     1585                for (int i = 0; i < block_index; ++i) 
     1586                { 
     1587                        pending_block& qe = m_download_queue[i]; 
    15871588 
    15881589#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 
    15891590                        (*m_logger) << time_now_string() 
    1590                                 << " *** SKIPPED_PIECE [ piece: " << i->block.piece_index << " | " 
    1591                                 "b: " << i->block.block_index << " ] ***\n"; 
    1592 #endif 
    1593  
    1594                         ++i->skipped; 
     1591                                << " *** SKIPPED_PIECE [ piece: " << eq.block.piece_index << " | " 
     1592                                "b: " << eq.block.block_index << " ] ***\n"; 
     1593#endif 
     1594 
     1595                        ++qe.skipped; 
    15951596                        // if the number of times a block is skipped by out of order 
    15961597                        // blocks exceeds the size of the outstanding queue, assume that 
    15971598                        // the other end dropped the request. 
    1598                         if (i->skipped > m_desired_queue_size) 
     1599                        if (qe.skipped > m_desired_queue_size) 
    15991600                        { 
    16001601                                if (m_ses.m_alerts.should_post<request_dropped_alert>()) 
    16011602                                        m_ses.m_alerts.post_alert(request_dropped_alert(t->get_handle() 
    1602                                                 , remote(), pid(), i->block.block_index, i->block.piece_index)); 
    1603                                 picker.abort_download(i->block); 
    1604                                 i = m_download_queue.erase(i); 
    1605                         } 
    1606                         else 
    1607                         { 
    1608                                 ++i; 
     1603                                                , remote(), pid(), qe.block.block_index, qe.block.piece_index)); 
     1604                                picker.abort_download(qe.block); 
     1605                                m_download_queue.erase(m_download_queue.begin() + i); 
     1606                                --i; 
     1607                                --block_index; 
    16091608                        } 
    16101609                } 
  • trunk/libtorrent/src/identify_client.cpp

    r3739 r3751  
    379379                for (peer_id::const_iterator i = p.begin(); i != p.end(); ++i) 
    380380                { 
    381                         unknown += isprint(*i)?*i:'.'; 
     381                        unknown += isprint(char(*i))?*i:'.'; 
    382382                } 
    383383                unknown += "]"; 
  • trunk/libtorrent/src/peer_connection.cpp

    r3739 r3751  
    15821582                } 
    15831583 
    1584                 for (std::deque<pending_block>::iterator i = m_download_queue.begin(); 
    1585                         i != b;) 
    1586                 { 
     1584                int block_index = b - m_download_queue.begin(); 
     1585                for (int i = 0; i < block_index; ++i) 
     1586                { 
     1587                        pending_block& qe = m_download_queue[i]; 
    15871588 
    15881589#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 
    15891590                        (*m_logger) << time_now_string() 
    1590                                 << " *** SKIPPED_PIECE [ piece: " << i->block.piece_index << " | " 
    1591                                 "b: " << i->block.block_index << " ] ***\n"; 
    1592 #endif 
    1593  
    1594                         ++i->skipped; 
     1591                                << " *** SKIPPED_PIECE [ piece: " << eq.block.piece_index << " | " 
     1592                                "b: " << eq.block.block_index << " ] ***\n"; 
     1593#endif 
     1594 
     1595                        ++qe.skipped; 
    15951596                        // if the number of times a block is skipped by out of order 
    15961597                        // blocks exceeds the size of the outstanding queue, assume that 
    15971598                        // the other end dropped the request. 
    1598                         if (i->skipped > m_desired_queue_size) 
     1599                        if (qe.skipped > m_desired_queue_size) 
    15991600                        { 
    16001601                                if (m_ses.m_alerts.should_post<request_dropped_alert>()) 
    16011602                                        m_ses.m_alerts.post_alert(request_dropped_alert(t->get_handle() 
    1602                                                 , remote(), pid(), i->block.block_index, i->block.piece_index)); 
    1603                                 picker.abort_download(i->block); 
    1604                                 i = m_download_queue.erase(i); 
    1605                         } 
    1606                         else 
    1607                         { 
    1608                                 ++i; 
     1603                                                , remote(), pid(), qe.block.block_index, qe.block.piece_index)); 
     1604                                picker.abort_download(qe.block); 
     1605                                m_download_queue.erase(m_download_queue.begin() + i); 
     1606                                --i; 
     1607                                --block_index; 
    16091608                        } 
    16101609                }