Changeset 3751
- Timestamp:
- 08/25/08 16:42:22 (3 months ago)
- Files:
-
- branches/1.0.0_RC/libtorrent/src/identify_client.cpp (modified) (1 diff)
- branches/1.0.0_RC/libtorrent/src/peer_connection.cpp (modified) (1 diff)
- trunk/libtorrent/src/identify_client.cpp (modified) (1 diff)
- trunk/libtorrent/src/peer_connection.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.0_RC/libtorrent/src/identify_client.cpp
r3740 r3751 379 379 for (peer_id::const_iterator i = p.begin(); i != p.end(); ++i) 380 380 { 381 unknown += isprint( *i)?*i:'.';381 unknown += isprint(char(*i))?*i:'.'; 382 382 } 383 383 unknown += "]"; branches/1.0.0_RC/libtorrent/src/peer_connection.cpp
r3740 r3751 1582 1582 } 1583 1583 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]; 1587 1588 1588 1589 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 1589 1590 (*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; 1595 1596 // if the number of times a block is skipped by out of order 1596 1597 // blocks exceeds the size of the outstanding queue, assume that 1597 1598 // the other end dropped the request. 1598 if ( i->skipped > m_desired_queue_size)1599 if (qe.skipped > m_desired_queue_size) 1599 1600 { 1600 1601 if (m_ses.m_alerts.should_post<request_dropped_alert>()) 1601 1602 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; 1609 1608 } 1610 1609 } trunk/libtorrent/src/identify_client.cpp
r3739 r3751 379 379 for (peer_id::const_iterator i = p.begin(); i != p.end(); ++i) 380 380 { 381 unknown += isprint( *i)?*i:'.';381 unknown += isprint(char(*i))?*i:'.'; 382 382 } 383 383 unknown += "]"; trunk/libtorrent/src/peer_connection.cpp
r3739 r3751 1582 1582 } 1583 1583 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]; 1587 1588 1588 1589 #if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_ERROR_LOGGING 1589 1590 (*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; 1595 1596 // if the number of times a block is skipped by out of order 1596 1597 // blocks exceeds the size of the outstanding queue, assume that 1597 1598 // the other end dropped the request. 1598 if ( i->skipped > m_desired_queue_size)1599 if (qe.skipped > m_desired_queue_size) 1599 1600 { 1600 1601 if (m_ses.m_alerts.should_post<request_dropped_alert>()) 1601 1602 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; 1609 1608 } 1610 1609 }
