forked from premiere/premiere-libtorrent
add moving_storage field to torrent_status
This commit is contained in:
parent
12ca5550d1
commit
dc2243c17e
|
@ -1,3 +1,4 @@
|
|||
* add moving_storage field to torrent_status
|
||||
* expose UPnP and NAT-PMP mapping in session object
|
||||
* DHT refactoring and support for storing arbitrary data with put
|
||||
* support building on android
|
||||
|
|
|
@ -1346,7 +1346,10 @@ namespace libtorrent
|
|||
// more blocks to disk!
|
||||
bool m_deleted:1;
|
||||
|
||||
// TODO: there's space for another 2 bits here
|
||||
// set to true while moving the storage
|
||||
bool m_moving_storage:1;
|
||||
|
||||
// TODO: there's space for another bit here
|
||||
|
||||
// ----
|
||||
|
||||
|
|
|
@ -1431,6 +1431,11 @@ namespace libtorrent
|
|||
// checked or as soon as one piece fails the hash check.
|
||||
bool seed_mode;
|
||||
|
||||
// this is true if this torrent's storage is currently being moved from
|
||||
// one location to another. This may potentially be a long operation
|
||||
// if a large file ends up being copied from one drive to another.
|
||||
bool moving_storage;
|
||||
|
||||
// the info-hash for this torrent
|
||||
sha1_hash info_hash;
|
||||
};
|
||||
|
|
|
@ -299,6 +299,7 @@ namespace libtorrent
|
|||
, m_is_active_finished(false)
|
||||
, m_ssl_torrent(false)
|
||||
, m_deleted(false)
|
||||
, m_moving_storage(false)
|
||||
, m_incomplete(0xffffff)
|
||||
, m_abort(false)
|
||||
, m_announce_to_dht((p.flags & add_torrent_params::flag_paused) == 0)
|
||||
|
@ -6506,6 +6507,7 @@ namespace libtorrent
|
|||
#endif
|
||||
m_owning_storage->async_move_storage(path, flags
|
||||
, boost::bind(&torrent::on_storage_moved, shared_from_this(), _1, _2));
|
||||
m_moving_storage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -6526,6 +6528,8 @@ namespace libtorrent
|
|||
{
|
||||
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||
|
||||
m_moving_storage = false;
|
||||
|
||||
if (ret == piece_manager::no_error || ret == piece_manager::need_full_check)
|
||||
{
|
||||
if (alerts().should_post<storage_moved_alert>())
|
||||
|
@ -8699,6 +8703,7 @@ namespace libtorrent
|
|||
st->has_incoming = m_has_incoming;
|
||||
if (m_error) st->error = convert_from_native(m_error.message()) + ": " + m_error_file;
|
||||
st->seed_mode = m_seed_mode;
|
||||
st->moving_storage = m_moving_storage;
|
||||
|
||||
st->added_time = m_added_time;
|
||||
st->completed_time = m_completed_time;
|
||||
|
|
|
@ -140,6 +140,7 @@ namespace libtorrent
|
|||
, has_metadata(false)
|
||||
, has_incoming(false)
|
||||
, seed_mode(false)
|
||||
, moving_storage(false)
|
||||
, info_hash(0)
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue