From d071961473762a61db1bcdaa6f4e34f705fba3a3 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Sat, 25 Aug 2007 22:43:36 +0000 Subject: [PATCH] lt bug fixes #1502 and #1500 --- libtorrent/include/libtorrent/bandwidth_manager.hpp | 1 + libtorrent/src/peer_connection.cpp | 1 + libtorrent/src/piece_picker.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/libtorrent/include/libtorrent/bandwidth_manager.hpp b/libtorrent/include/libtorrent/bandwidth_manager.hpp index 6c840d5a3..f4663f39a 100644 --- a/libtorrent/include/libtorrent/bandwidth_manager.hpp +++ b/libtorrent/include/libtorrent/bandwidth_manager.hpp @@ -341,6 +341,7 @@ private: { assert(amount == limit - m_current_quota); bw_queue_entry qe = m_queue.front(); + assert(qe.max_block_size > 0); m_queue.pop_front(); shared_ptr t = qe.peer->associated_torrent().lock(); diff --git a/libtorrent/src/peer_connection.cpp b/libtorrent/src/peer_connection.cpp index 6bc604bab..7b4975987 100755 --- a/libtorrent/src/peer_connection.cpp +++ b/libtorrent/src/peer_connection.cpp @@ -189,6 +189,7 @@ namespace libtorrent , m_download_limit(bandwidth_limit::inf) , m_peer_info(peerinfo) , m_speed(slow) + , m_connection_ticket(-1) , m_remote_bytes_dled(0) , m_remote_dl_rate(0) , m_remote_dl_update(time_now()) diff --git a/libtorrent/src/piece_picker.cpp b/libtorrent/src/piece_picker.cpp index 8eb79b149..8a86636b3 100755 --- a/libtorrent/src/piece_picker.cpp +++ b/libtorrent/src/piece_picker.cpp @@ -645,6 +645,7 @@ namespace libtorrent if (j->finished + j->writing >= complete) return; using std::swap; swap(*j, *i); + if (j == m_downloads.begin()) break; } }