From 9333c51da6201c0a27a81564f13d0064a80b6367 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sun, 14 May 2017 12:14:32 -0400 Subject: [PATCH] deprecate partial_piece_info::piece_state --- ChangeLog | 1 + include/libtorrent/torrent_handle.hpp | 8 +++++++- src/torrent.cpp | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3693722b3..0b0322552 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ + * deprecate partial_piece_info::piece_state * bind upnp requests to correct local address * save resume data when removing web seeds * fix proxying of https connections diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index b667118ff..ff75ef692 100644 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -188,6 +188,7 @@ namespace libtorrent // get_download_queue() is called, it will be invalidated. block_info* blocks; +#ifndef TORRENT_NO_DEPRECATE // the speed classes. These may be used by the piece picker to // coalesce requests of similar download rates enum state_t { none, slow, medium, fast }; @@ -204,7 +205,12 @@ namespace libtorrent // downloaded pieces down. Pieces set to ``none`` can be converted into // any of ``fast``, ``medium`` or ``slow`` as soon as a peer want to // download from it. - state_t piece_state; + state_t TORRENT_DEPRECATED_MEMBER piece_state; +#else + // hidden + enum deprecated_state_t { none, slow, medium, fast }; + deprecated_state_t deprecated_piece_state; +#endif }; // for boost::hash (and to support using this type in unordered_map etc.) diff --git a/src/torrent.cpp b/src/torrent.cpp index 71e072460..d35d60de6 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -7617,6 +7617,11 @@ namespace libtorrent pi.finished = int(i->finished); pi.writing = int(i->writing); pi.requested = int(i->requested); +#ifndef TORRENT_NO_DEPRECATE + pi.piece_state = partial_piece_info::none; +#else + pi.deprecated_piece_state = partial_piece_info::none; +#endif TORRENT_ASSERT(counter * blocks_per_piece + pi.blocks_in_piece <= int(blk.size())); pi.blocks = &blk[counter * blocks_per_piece]; int piece_size = int(torrent_file().piece_size(i->index));