*** empty log message ***
This commit is contained in:
parent
fd9fba2964
commit
b716a40795
|
@ -1075,7 +1075,6 @@ namespace libtorrent
|
|||
for (map_iter i = begin2; i != end2; ++i)
|
||||
matching_pieces.push_back(i->second);
|
||||
|
||||
|
||||
// no piece matched the data in the slot
|
||||
if (matching_pieces.empty())
|
||||
return -1;
|
||||
|
@ -1124,8 +1123,11 @@ namespace libtorrent
|
|||
assert(m_piece_to_slot[piece_index] != current_slot);
|
||||
assert(m_piece_to_slot[piece_index] >= 0);
|
||||
m_piece_to_slot[piece_index] = has_no_slot;
|
||||
have_pieces[piece_index] = false;
|
||||
}
|
||||
|
||||
assert(have_pieces[piece_index] == false);
|
||||
assert(m_piece_to_slot[piece_index] == has_no_slot);
|
||||
have_pieces[piece_index] = true;
|
||||
return piece_index;
|
||||
}
|
||||
|
@ -1142,9 +1144,19 @@ namespace libtorrent
|
|||
break;
|
||||
}
|
||||
|
||||
if (free_piece >= 0) have_pieces[free_piece] = true;
|
||||
if (free_piece >= 0)
|
||||
{
|
||||
assert(have_pieces[free_piece] == false);
|
||||
assert(m_piece_to_slot[free_piece] == has_no_slot);
|
||||
have_pieces[free_piece] = true;
|
||||
return free_piece;
|
||||
}
|
||||
else
|
||||
{
|
||||
assert(free_piece == -1);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void piece_manager::impl::check_pieces(
|
||||
boost::mutex& mutex
|
||||
|
@ -1256,12 +1268,14 @@ namespace libtorrent
|
|||
|
||||
// the slot was identified as piece 'piece_index'
|
||||
m_piece_to_slot[piece_index] = current_slot;
|
||||
|
||||
m_slot_to_piece[current_slot] = piece_index;
|
||||
}
|
||||
else
|
||||
{
|
||||
// the data in the slot was not recognized
|
||||
// consider the slot free
|
||||
assert(m_slot_to_piece[current_slot]==unallocated);
|
||||
m_slot_to_piece[current_slot] = unassigned;
|
||||
m_free_slots.push_back(current_slot);
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@ namespace libtorrent
|
|||
, m_storage(m_torrent_file, save_path)
|
||||
, m_next_request(boost::posix_time::second_clock::local_time())
|
||||
, m_duration(1800)
|
||||
, m_policy(new policy(this))
|
||||
, m_policy(new policy(this)) // warning: uses this in member init list
|
||||
, m_ses(ses)
|
||||
, m_picker(torrent_file.piece_length() / m_block_size,
|
||||
static_cast<int>((torrent_file.total_size()+m_block_size-1)/m_block_size))
|
||||
|
|
Loading…
Reference in New Issue