widen some fields in torrent

This commit is contained in:
Arvid Norberg 2013-01-20 08:36:34 +00:00
parent ab7369fee9
commit aa9918a602
2 changed files with 14 additions and 14 deletions

View File

@ -821,7 +821,7 @@ namespace libtorrent
m_verified.free(); m_verified.free();
} }
bool all_verified() const bool all_verified() const
{ return m_num_verified == m_torrent_file->num_pieces(); } { return int(m_num_verified) == m_torrent_file->num_pieces(); }
bool verified_piece(int piece) const bool verified_piece(int piece) const
{ {
TORRENT_ASSERT(piece < int(m_verified.size())); TORRENT_ASSERT(piece < int(m_verified.size()));
@ -1102,6 +1102,9 @@ namespace libtorrent
// in this swarm // in this swarm
time_t m_swarm_last_seen_complete; time_t m_swarm_last_seen_complete;
// m_num_verified = m_verified.count()
boost::uint32_t m_num_verified;
#ifndef TORRENT_DISABLE_ENCRYPTION #ifndef TORRENT_DISABLE_ENCRYPTION
// this is SHA1("req2" + info-hash), used for // this is SHA1("req2" + info-hash), used for
// encrypted hand shakes // encrypted hand shakes
@ -1314,21 +1317,18 @@ namespace libtorrent
// this is set when the torrent is in share-mode // this is set when the torrent is in share-mode
bool m_share_mode:1; bool m_share_mode:1;
// m_num_verified = m_verified.count() // the number of seconds since the last piece passed for
boost::uint16_t m_num_verified; // this torrent
boost::uint32_t m_last_download:24;
// the number of seconds since the last byte was uploaded
// from this torrent
boost::uint32_t m_last_upload:24;
// the number of seconds since the last scrape request to // the number of seconds since the last scrape request to
// one of the trackers in this torrent // one of the trackers in this torrent
boost::uint16_t m_last_scrape; boost::uint16_t m_last_scrape;
// the number of seconds since the last piece passed for
// this torrent
boost::uint16_t m_last_download;
// the number of seconds since the last byte was uploaded
// from this torrent
boost::uint16_t m_last_upload;
// the scrape data from the tracker response, this // the scrape data from the tracker response, this
// is optional and may be 0xffffff // is optional and may be 0xffffff
unsigned int m_downloaders:24; unsigned int m_downloaders:24;

View File

@ -259,6 +259,7 @@ namespace libtorrent
PRINT_OFFSETOF(torrent, m_last_saved_resume) PRINT_OFFSETOF(torrent, m_last_saved_resume)
PRINT_OFFSETOF(torrent, m_last_seen_complete) PRINT_OFFSETOF(torrent, m_last_seen_complete)
PRINT_OFFSETOF(torrent, m_swarm_last_seen_complete) PRINT_OFFSETOF(torrent, m_swarm_last_seen_complete)
PRINT_OFFSETOF(torrent, m_num_verified)
#ifndef TORRENT_DISABLE_ENCRYPTION #ifndef TORRENT_DISABLE_ENCRYPTION
PRINT_OFFSETOF(torrent, m_obfuscated_hash) PRINT_OFFSETOF(torrent, m_obfuscated_hash)
#endif #endif
@ -307,7 +308,6 @@ namespace libtorrent
// PRINT_OFFSETOF(torrent, m_allow_peers:1) // PRINT_OFFSETOF(torrent, m_allow_peers:1)
// PRINT_OFFSETOF(torrent, m_upload_mode:1) // PRINT_OFFSETOF(torrent, m_upload_mode:1)
// PRINT_OFFSETOF(torrent, m_auto_managed:1) // PRINT_OFFSETOF(torrent, m_auto_managed:1)
PRINT_OFFSETOF(torrent, m_num_verified)
PRINT_OFFSETOF(torrent, m_last_scrape) PRINT_OFFSETOF(torrent, m_last_scrape)
} }
#undef PRINT_SIZEOF #undef PRINT_SIZEOF
@ -361,6 +361,7 @@ namespace libtorrent
, m_last_saved_resume(time(0)) , m_last_saved_resume(time(0))
, m_last_seen_complete(0) , m_last_seen_complete(0)
, m_swarm_last_seen_complete(0) , m_swarm_last_seen_complete(0)
, m_num_verified(0)
, m_ratio(0.f) , m_ratio(0.f)
, m_available_free_upload(0) , m_available_free_upload(0)
, m_average_piece_time(0) , m_average_piece_time(0)
@ -410,10 +411,9 @@ namespace libtorrent
, m_upload_mode(p.flags & add_torrent_params::flag_upload_mode) , m_upload_mode(p.flags & add_torrent_params::flag_upload_mode)
, m_auto_managed(p.flags & add_torrent_params::flag_auto_managed) , m_auto_managed(p.flags & add_torrent_params::flag_auto_managed)
, m_share_mode(p.flags & add_torrent_params::flag_share_mode) , m_share_mode(p.flags & add_torrent_params::flag_share_mode)
, m_num_verified(0)
, m_last_scrape(0)
, m_last_download(0) , m_last_download(0)
, m_last_upload(0) , m_last_upload(0)
, m_last_scrape(0)
, m_downloaders(0xffffff) , m_downloaders(0xffffff)
, m_interface_index(0) , m_interface_index(0)
, m_graceful_pause_mode(false) , m_graceful_pause_mode(false)