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