From db4ca12c026438e0fbc734d6ea168f34eacd9154 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sat, 24 Jun 2006 14:15:11 +0000 Subject: [PATCH] fixed a full-check bug in storage. Changed the asio includes to avoid require boost.regex headers --- ChangeLog | 2 ++ include/libtorrent/socket.hpp | 6 +++++- src/storage.cpp | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 166b62993..f137a3af8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ + * fixed a bug in storage that would, in rare cases, fail to do a + complete check. * exposed more settings for tweaking parameters in the piece-picker, downloader and uploader (http_settings replaced by session_settings). * tweaked default settings to improve high bandwidth transfers. diff --git a/include/libtorrent/socket.hpp b/include/libtorrent/socket.hpp index 5372b3650..c680617d2 100755 --- a/include/libtorrent/socket.hpp +++ b/include/libtorrent/socket.hpp @@ -45,7 +45,11 @@ POSSIBILITY OF SUCH DAMAGE. #define Protocol Protocol_ #endif -#include +#include +#include +#include +#include +#include #ifdef __OBJC__ #undef Protocol diff --git a/src/storage.cpp b/src/storage.cpp index 574c18bc2..3e83fcc0f 100755 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1289,6 +1289,7 @@ namespace libtorrent have_pieces[other_piece] = true; m_slot_to_piece[other_slot] = other_piece; m_piece_to_slot[other_piece] = other_slot; + ++num_pieces; } else { @@ -1304,6 +1305,7 @@ namespace libtorrent assert(m_piece_to_slot[piece_index] >= 0); m_piece_to_slot[piece_index] = has_no_slot; #ifndef NDEBUG + // to make the assert happy, a few lines down have_pieces[piece_index] = false; #endif }