mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-18 14:26:24 +00:00
lt sync 2823
This commit is contained in:
parent
86d1624cff
commit
a555fecc18
@ -304,8 +304,8 @@ namespace libtorrent
|
|||||||
TORRENT_ASSERT(t1);
|
TORRENT_ASSERT(t1);
|
||||||
boost::shared_ptr<torrent> t2 = rhs.associated_torrent().lock();
|
boost::shared_ptr<torrent> t2 = rhs.associated_torrent().lock();
|
||||||
TORRENT_ASSERT(t2);
|
TORRENT_ASSERT(t2);
|
||||||
if (!is_choked()) c1 -= t1->torrent_file().piece_length();
|
if (!is_choked()) c1 -= (std::max)(t1->torrent_file().piece_length(), 256 * 1024);
|
||||||
if (!rhs.is_choked()) c2 -= t2->torrent_file().piece_length();
|
if (!rhs.is_choked()) c2 -= (std::max)(t2->torrent_file().piece_length(), 256 * 1024);
|
||||||
|
|
||||||
return c1 < c2;
|
return c1 < c2;
|
||||||
}
|
}
|
||||||
|
@ -996,10 +996,6 @@ namespace libtorrent
|
|||||||
#ifdef TORRENT_PICKER_LOG
|
#ifdef TORRENT_PICKER_LOG
|
||||||
print_pieces();
|
print_pieces();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NDEBUG
|
|
||||||
check_invariant();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void piece_picker::we_dont_have(int index)
|
void piece_picker::we_dont_have(int index)
|
||||||
|
@ -338,8 +338,7 @@ namespace libtorrent
|
|||||||
piece_picker* p = 0;
|
piece_picker* p = 0;
|
||||||
if (m_torrent->has_picker())
|
if (m_torrent->has_picker())
|
||||||
p = &m_torrent->picker();
|
p = &m_torrent->picker();
|
||||||
for (iterator i = m_peers.begin()
|
for (iterator i = m_peers.begin(); i != m_peers.end();)
|
||||||
, end(m_peers.end()); i != end;)
|
|
||||||
{
|
{
|
||||||
if ((ses.m_ip_filter.access(i->second.addr) & ip_filter::blocked) == 0)
|
if ((ses.m_ip_filter.access(i->second.addr) & ip_filter::blocked) == 0)
|
||||||
{
|
{
|
||||||
|
@ -309,6 +309,13 @@ namespace libtorrent
|
|||||||
int ret = load_file(filename, buf);
|
int ret = load_file(filename, buf);
|
||||||
if (ret < 0) return;
|
if (ret < 0) return;
|
||||||
|
|
||||||
|
if (buf.empty())
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
|
throw invalid_torrent_file();
|
||||||
|
#else
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
lazy_entry e;
|
lazy_entry e;
|
||||||
lazy_bdecode(&buf[0], &buf[0] + buf.size(), e);
|
lazy_bdecode(&buf[0], &buf[0] + buf.size(), e);
|
||||||
std::string error;
|
std::string error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user