forked from premiere/premiere-libtorrent
fixed issue with torrents with 0 pieces. Fixes #306
This commit is contained in:
parent
fb154e91f8
commit
91d6099a55
|
@ -288,6 +288,7 @@ namespace libtorrent
|
||||||
|
|
||||||
void peer_connection::start()
|
void peer_connection::start()
|
||||||
{
|
{
|
||||||
|
TORRENT_ASSERT(m_peer_info == 0 || m_peer_info->connection == this);
|
||||||
boost::shared_ptr<torrent> t = m_torrent.lock();
|
boost::shared_ptr<torrent> t = m_torrent.lock();
|
||||||
|
|
||||||
if (!t)
|
if (!t)
|
||||||
|
|
|
@ -2465,7 +2465,8 @@ namespace libtorrent
|
||||||
&& m_free_slots.empty()
|
&& m_free_slots.empty()
|
||||||
&& m_state == state_finished)
|
&& m_state == state_finished)
|
||||||
{
|
{
|
||||||
TORRENT_ASSERT(m_storage_mode != storage_mode_compact);
|
TORRENT_ASSERT(m_storage_mode != storage_mode_compact
|
||||||
|
|| m_info->num_pieces() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_storage_mode != storage_mode_compact)
|
if (m_storage_mode != storage_mode_compact)
|
||||||
|
|
|
@ -2579,6 +2579,7 @@ namespace libtorrent
|
||||||
// add the newly connected peer to this torrent's peer list
|
// add the newly connected peer to this torrent's peer list
|
||||||
m_connections.insert(boost::get_pointer(c));
|
m_connections.insert(boost::get_pointer(c));
|
||||||
m_ses.m_connections.insert(c);
|
m_ses.m_connections.insert(c);
|
||||||
|
peerinfo->connection = c.get();
|
||||||
c->start();
|
c->start();
|
||||||
|
|
||||||
int timeout = settings().peer_connect_timeout;
|
int timeout = settings().peer_connect_timeout;
|
||||||
|
@ -2603,7 +2604,6 @@ namespace libtorrent
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
peerinfo->connection = c.get();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue