mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-11 07:17:53 +00:00
some crash fixes, disable ut_metadata, fix m_name
This commit is contained in:
parent
33d44cf473
commit
e4a943c745
@ -222,13 +222,6 @@ namespace libtorrent
|
|||||||
};
|
};
|
||||||
|
|
||||||
void delete_one_file(std::string const& p);
|
void delete_one_file(std::string const& p);
|
||||||
int readwritev(file::iovec_t const* bufs, int slot, int offset
|
|
||||||
, int num_bufs, fileop const&);
|
|
||||||
|
|
||||||
size_type read_unaligned(boost::intrusive_ptr<file> const& file_handle
|
|
||||||
, size_type file_offset, file::iovec_t const* bufs, int num_bufs, error_code& ec);
|
|
||||||
size_type write_unaligned(boost::intrusive_ptr<file> const& file_handle
|
|
||||||
, size_type file_offset, file::iovec_t const* bufs, int num_bufs, error_code& ec);
|
|
||||||
|
|
||||||
file_storage const& files() const { return m_mapped_files?*m_mapped_files:m_files; }
|
file_storage const& files() const { return m_mapped_files?*m_mapped_files:m_files; }
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ namespace libtorrent
|
|||||||
if (flags & add_default_plugins)
|
if (flags & add_default_plugins)
|
||||||
{
|
{
|
||||||
add_extension(create_ut_pex_plugin);
|
add_extension(create_ut_pex_plugin);
|
||||||
add_extension(create_ut_metadata_plugin);
|
//add_extension(create_ut_metadata_plugin);
|
||||||
add_extension(create_lt_trackers_plugin);
|
add_extension(create_lt_trackers_plugin);
|
||||||
add_extension(create_smart_ban_plugin);
|
add_extension(create_smart_ban_plugin);
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,9 @@ namespace libtorrent
|
|||||||
, m_is_active_download(false)
|
, m_is_active_download(false)
|
||||||
, m_is_active_finished(false)
|
, m_is_active_finished(false)
|
||||||
{
|
{
|
||||||
// if there is resume data already, we don't need to trigger the initial save
|
if (!p.name.empty()) m_name.reset(new std::string(p.name));
|
||||||
|
|
||||||
|
// if there is resume data already, we don't need to trigger the initial save
|
||||||
// resume data
|
// resume data
|
||||||
if (!p.resume_data.empty() && (p.flags & add_torrent_params::flag_override_resume_data) == 0)
|
if (!p.resume_data.empty() && (p.flags & add_torrent_params::flag_override_resume_data) == 0)
|
||||||
m_need_save_resume_data = false;
|
m_need_save_resume_data = false;
|
||||||
@ -467,10 +469,6 @@ namespace libtorrent
|
|||||||
m_connections_initialized = true;
|
m_connections_initialized = true;
|
||||||
m_block_size_shift = root2((std::min)(block_size, m_torrent_file->piece_length()));
|
m_block_size_shift = root2((std::min)(block_size, m_torrent_file->piece_length()));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!p.name.empty()) m_name.reset(new std::string(p.name));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_url.empty() && m_uuid.empty()) m_uuid = m_url;
|
if (!m_url.empty() && m_uuid.empty()) m_uuid = m_url;
|
||||||
|
|
||||||
@ -2097,6 +2095,7 @@ namespace libtorrent
|
|||||||
{
|
{
|
||||||
TORRENT_ASSERT(m_ses.is_network_thread());
|
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||||
if (!m_ses.m_dht) return;
|
if (!m_ses.m_dht) return;
|
||||||
|
if (!m_name) return;
|
||||||
if (!should_announce_dht()) return;
|
if (!should_announce_dht()) return;
|
||||||
|
|
||||||
TORRENT_ASSERT(m_allow_peers);
|
TORRENT_ASSERT(m_allow_peers);
|
||||||
@ -2110,7 +2109,7 @@ namespace libtorrent
|
|||||||
policy::peer const* p = *i;
|
policy::peer const* p = *i;
|
||||||
|
|
||||||
if( p->connectable && !p->banned ) {
|
if( p->connectable && !p->banned ) {
|
||||||
m_ses.m_dht->announce(*m_name, m_torrent_file->info_hash()
|
m_ses.m_dht->announce(name(), m_torrent_file->info_hash()
|
||||||
, p->address(), p->port, p->seed, false
|
, p->address(), p->port, p->seed, false
|
||||||
, boost::bind(&nop));
|
, boost::bind(&nop));
|
||||||
}
|
}
|
||||||
@ -2124,7 +2123,7 @@ namespace libtorrent
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
boost::weak_ptr<torrent> self(shared_from_this());
|
boost::weak_ptr<torrent> self(shared_from_this());
|
||||||
m_ses.m_dht->announce(*m_name, m_torrent_file->info_hash()
|
m_ses.m_dht->announce(name(), m_torrent_file->info_hash()
|
||||||
, m_ses.external_address().external_address(address_v4()), port, is_seed(), true
|
, m_ses.external_address().external_address(address_v4()), port, is_seed(), true
|
||||||
, boost::bind(&torrent::on_dht_announce_response_disp, self, _1));
|
, boost::bind(&torrent::on_dht_announce_response_disp, self, _1));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user