mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-26 03:09:13 +00:00
lt sync 2828
This commit is contained in:
parent
a352202247
commit
9c0dc5f9e3
@ -376,6 +376,9 @@ namespace libtorrent
|
||||
// the piece_manager destructs. This is because
|
||||
// the torrent_info object is owned by the torrent.
|
||||
boost::shared_ptr<void> m_torrent;
|
||||
#ifndef NDEBUG
|
||||
bool m_resume_data_verified;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#endif
|
||||
|
||||
#include "libtorrent/enum_net.hpp"
|
||||
// for is_loopback and is_any
|
||||
#include "libtorrent/broadcast_socket.hpp"
|
||||
|
||||
namespace libtorrent
|
||||
{
|
||||
|
@ -1855,7 +1855,6 @@ namespace detail
|
||||
{
|
||||
tracker_request req = t.generate_tracker_request();
|
||||
TORRENT_ASSERT(req.event == tracker_request::stopped);
|
||||
TORRENT_ASSERT(!m_listen_sockets.empty());
|
||||
req.listen_port = 0;
|
||||
if (!m_listen_sockets.empty())
|
||||
req.listen_port = m_listen_sockets.front().external_port;
|
||||
|
@ -581,8 +581,9 @@ namespace libtorrent
|
||||
// the resume data says we have the entire torrent
|
||||
// make sure the file sizes are the right ones
|
||||
for (torrent_info::file_iterator i = m_info->begin_files(true)
|
||||
, end(m_info->end_files(true)); i != end; ++i, ++fs)
|
||||
, end(m_info->end_files(true)); i != end; ++i, ++fs)
|
||||
{
|
||||
std::cerr << "filesize: " << i->size << std::endl;
|
||||
if (i->size != fs->first)
|
||||
{
|
||||
error = "file size for '" + i->path.native_file_string()
|
||||
@ -591,7 +592,6 @@ namespace libtorrent
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return match_filesizes(*m_info, m_save_path, file_sizes
|
||||
@ -998,6 +998,9 @@ namespace libtorrent
|
||||
, m_io_thread(io)
|
||||
, m_torrent(torrent)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
m_resume_data_verified = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
piece_manager::~piece_manager()
|
||||
@ -1011,6 +1014,9 @@ namespace libtorrent
|
||||
|
||||
bool piece_manager::verify_resume_data(entry& rd, std::string& error)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
m_resume_data_verified = true;
|
||||
#endif
|
||||
return m_storage->verify_resume_data(rd, error);
|
||||
}
|
||||
|
||||
@ -1473,6 +1479,7 @@ namespace libtorrent
|
||||
if (!data.piece_map.empty()
|
||||
&& int(data.piece_map.size()) <= m_info->num_pieces())
|
||||
{
|
||||
TORRENT_ASSERT(m_resume_data_verified);
|
||||
for (int i = 0; i < (int)data.piece_map.size(); ++i)
|
||||
{
|
||||
m_slot_to_piece[i] = data.piece_map[i];
|
||||
|
Loading…
x
Reference in New Issue
Block a user