Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.2.13 released

* fix super-seeding issue that could cause a segfault
* fix data race in python binding of session::get_torrent_status()
* fix need_save_resume_data() for renaming files, share-mode, upload-mode,
disable- pex, lsd, and dht.
Expand Down
3 changes: 3 additions & 0 deletions src/peer_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,11 +1048,14 @@ namespace libtorrent {
bool peer_connection::has_piece(piece_index_t const i) const
{
TORRENT_ASSERT(is_single_thread());
#if TORRENT_USE_ASSERTS
std::shared_ptr<torrent> t = m_torrent.lock();
TORRENT_ASSERT(t);
TORRENT_ASSERT(t->valid_metadata());
TORRENT_ASSERT(i >= piece_index_t(0));
TORRENT_ASSERT(i < t->torrent_file().end_piece());
#endif
if (m_have_piece.empty()) return false;
return m_have_piece[i];
}

Expand Down