diff --git a/include/libtorrent/aux_/session_impl.hpp b/include/libtorrent/aux_/session_impl.hpp index a397c7b65..060f41a75 100644 --- a/include/libtorrent/aux_/session_impl.hpp +++ b/include/libtorrent/aux_/session_impl.hpp @@ -415,7 +415,7 @@ namespace libtorrent , boost::uint32_t flags) const; void refresh_torrent_status(std::vector* ret , boost::uint32_t flags) const; - void post_torrent_updates(); + void post_torrent_updates(boost::uint32_t flags); void post_session_stats(); void post_dht_stats(); diff --git a/include/libtorrent/session.hpp b/include/libtorrent/session.hpp index 3914ec8b0..b09e7820a 100644 --- a/include/libtorrent/session.hpp +++ b/include/libtorrent/session.hpp @@ -355,7 +355,9 @@ namespace libtorrent // // Only torrents who has the state subscription flag set will be // included. This flag is on by default. See add_torrent_params. - void post_torrent_updates(); + // the ``flags`` argument is the same as for torrent_handle::status(). + // see torrent_handle::status_flags_t. + void post_torrent_updates(boost::uint32_t flags = 0xffffffff); // This function will post a session_stats_alert object, containing a // snapshot of the performance counters from the internals of libtorrent. diff --git a/src/session.cpp b/src/session.cpp index 6723cc71b..42d470613 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -568,9 +568,9 @@ namespace libtorrent TORRENT_SYNC_CALL2(refresh_torrent_status, ret, flags); } - void session::post_torrent_updates() + void session::post_torrent_updates(boost::uint32_t flags) { - TORRENT_ASYNC_CALL(post_torrent_updates); + TORRENT_ASYNC_CALL1(post_torrent_updates, flags); } std::vector session_stats_metrics() diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 11b62f364..bfd4a6ab5 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -4303,7 +4303,7 @@ retry: } } - void session_impl::post_torrent_updates() + void session_impl::post_torrent_updates(boost::uint32_t flags) { INVARIANT_CHECK; @@ -4333,7 +4333,7 @@ retry: // the torrent to be loaded. Loading a torrent, and evicting another // one will lead to calling state_updated(), which screws with // this list while we're working on it, and break things - t->status(&alert->status.back(), ~torrent_handle::query_accurate_download_counters); + t->status(&alert->status.back(), flags); t->clear_in_state_update(); } state_updates.clear();