diff --git a/docs/manual.rst b/docs/manual.rst index 9b193e55f..0b55945e0 100644 --- a/docs/manual.rst +++ b/docs/manual.rst @@ -2359,7 +2359,6 @@ Its declaration looks like this:: void rename_file(int index, boost::filesystem::wpath) const; storage_interface* get_storage_impl() const; - bool super_seeding() const; void super_seeding(bool on) const; enum flags_t { overwrite_existing = 1 }; @@ -2586,12 +2585,10 @@ super_seeding() :: - bool super_seeding() const; void super_seeding(bool on) const; Enables or disabled super seeding/initial seeding for this torrent. The torrent -needs to be a seed for this to take effect. The overload that returns a bool -tells you of super seeding is enabled or not. +needs to be a seed for this to take effect. add_piece() ----------- @@ -3479,6 +3476,7 @@ It contains the following fields:: bool seed_mode; bool upload_mode; bool share_mode; + bool super_seeding; int priority; @@ -3750,6 +3748,8 @@ torrent_handle_. ``share_mode`` is true if the torrent is currently in share-mode, i.e. not downloading the torrent, but just helping the swarm out. +``super_seeding`` is true if the torrent is in super seeding mode. + ``added_time`` is the posix-time when this torrent was added. i.e. what ``time(NULL)`` returned at the time. diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index 55b02a573..48dab2738 100644 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -296,6 +296,8 @@ namespace libtorrent bool is_sequential_download() const TORRENT_DEPRECATED; TORRENT_DEPRECATED_PREFIX bool has_metadata() const TORRENT_DEPRECATED; + TORRENT_DEPRECATED_PREFIX + bool super_seeding() const TORRENT_DEPRECATED; // deprecated in 0.13 // marks the piece with the given index as filtered @@ -402,7 +404,6 @@ namespace libtorrent void rename_file(int index, std::wstring const& new_name) const; #endif - bool super_seeding() const; void super_seeding(bool on) const; sha1_hash info_hash() const; @@ -486,6 +487,7 @@ namespace libtorrent , seed_mode(false) , upload_mode(false) , share_mode(false) + , super_seeding(false) , priority(0) , added_time(0) , completed_time(0) @@ -690,6 +692,9 @@ namespace libtorrent // this is true if the torrent is in share-mode bool share_mode; + // true if the torrent is in super seeding mode + bool super_seeding; + // the priority of this torrent int priority; diff --git a/src/torrent.cpp b/src/torrent.cpp index 75001a248..9b83d31ba 100644 --- a/src/torrent.cpp +++ b/src/torrent.cpp @@ -8165,6 +8165,7 @@ namespace libtorrent st->sequential_download = m_sequential_download; st->is_seeding = is_seed(); st->is_finished = is_finished(); + st->super_seeding = m_super_seeding; st->has_metadata = valid_metadata(); bytes_done(*st, flags & torrent_handle::query_accurate_download_counters); TORRENT_ASSERT(st->total_wanted_done >= 0); diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp index e8c2516c6..a9d499c62 100644 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -658,6 +658,13 @@ namespace libtorrent TORRENT_ASYNC_CALL1(filter_files, files); } + bool torrent_handle::super_seeding() const + { + INVARIANT_CHECK; + TORRENT_SYNC_CALL_RET(bool, false, super_seeding); + return r; + } + // ============ end deprecation =============== #endif @@ -841,13 +848,6 @@ namespace libtorrent TORRENT_ASYNC_CALL(scrape_tracker); } - bool torrent_handle::super_seeding() const - { - INVARIANT_CHECK; - TORRENT_SYNC_CALL_RET(bool, false, super_seeding); - return r; - } - void torrent_handle::super_seeding(bool on) const { INVARIANT_CHECK;