From 6410cac43c36986d93e4cc75f5f469871d76074f Mon Sep 17 00:00:00 2001 From: spyhole Date: Sat, 2 Jul 2005 08:47:46 +0000 Subject: [PATCH] torrent.cpp --- src/torrent.cpp | 23 +++++++++++++++++++++++ src/torrent_handle.cpp | 11 ++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/torrent.cpp b/src/torrent.cpp index 825932910..3c4f90251 100755 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -632,6 +632,29 @@ namespace libtorrent m_picker->filtered_pieces(bitmask); } + //idea from Arvid and MooPolice + //todo refactoring and improving the function body + void torrent::filter_file(int index, bool filter) + { + __int64 start_position = 0; + int start_piece_index = 0; + int end_piece_index = 0; + + for(int i=0;i const& urls) { assert(!urls.empty()); diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp index 4a814a909..5da1e4bf5 100755 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -285,7 +285,16 @@ namespace libtorrent , bind(&torrent::filtered_pieces, _1, boost::ref(ret))); return ret; } - + + //idea from Arvid and MooPolice + //todo refactoring and improving the function body + void torrent_handle::filter_file(int index, bool filter) + { + INVARIANT_CHECK; + call_member(m_ses, m_chk, m_info_hash + , bind(&torrent::filter_file, _1, index, filter)); + } + std::vector const& torrent_handle::trackers() const { INVARIANT_CHECK;