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()
|
||||
{
|
||||
TORRENT_ASSERT(m_peer_info == 0 || m_peer_info->connection == this);
|
||||
boost::shared_ptr<torrent> t = m_torrent.lock();
|
||||
|
||||
if (!t)
|
||||
|
|
|
@ -2465,7 +2465,8 @@ namespace libtorrent
|
|||
&& m_free_slots.empty()
|
||||
&& 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)
|
||||
|
|
|
@ -2579,6 +2579,7 @@ namespace libtorrent
|
|||
// add the newly connected peer to this torrent's peer list
|
||||
m_connections.insert(boost::get_pointer(c));
|
||||
m_ses.m_connections.insert(c);
|
||||
peerinfo->connection = c.get();
|
||||
c->start();
|
||||
|
||||
int timeout = settings().peer_connect_timeout;
|
||||
|
@ -2603,7 +2604,6 @@ namespace libtorrent
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
peerinfo->connection = c.get();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue