mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-09 14:28:22 +00:00
another we_dont_have() due to disk read error.
the idea is to help recovering faster from db corruption problems.
This commit is contained in:
parent
ddd5e332a3
commit
1ae5745151
@ -529,6 +529,8 @@ namespace libtorrent
|
|||||||
// only once per piece
|
// only once per piece
|
||||||
void we_have(int index, boost::uint32_t post_flags);
|
void we_have(int index, boost::uint32_t post_flags);
|
||||||
|
|
||||||
|
void we_dont_have(int index);
|
||||||
|
|
||||||
int num_have() const
|
int num_have() const
|
||||||
{
|
{
|
||||||
return has_picker()
|
return has_picker()
|
||||||
|
@ -4571,6 +4571,11 @@ namespace libtorrent
|
|||||||
|
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
{
|
{
|
||||||
|
if (t->has_picker() && t->have_piece(j.piece) ) {
|
||||||
|
printf("on_disk_read_complete: read error (database corrupt?) - setting we_dont_have(%d)\n", j.piece);
|
||||||
|
t->we_dont_have(j.piece);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == -3)
|
if (ret == -3)
|
||||||
{
|
{
|
||||||
#if defined TORRENT_VERBOSE_LOGGING
|
#if defined TORRENT_VERBOSE_LOGGING
|
||||||
|
@ -944,7 +944,7 @@ namespace libtorrent
|
|||||||
pieces->push_back( std::string(j.buffer, ret));
|
pieces->push_back( std::string(j.buffer, ret));
|
||||||
} else {
|
} else {
|
||||||
printf("piece read error (database corrupt?) - setting we_dont_have(%d)\n", j.piece);
|
printf("piece read error (database corrupt?) - setting we_dont_have(%d)\n", j.piece);
|
||||||
m_picker->we_dont_have(j.piece);
|
we_dont_have(j.piece);
|
||||||
}
|
}
|
||||||
(*reqs)--;
|
(*reqs)--;
|
||||||
|
|
||||||
@ -3113,6 +3113,16 @@ namespace libtorrent
|
|||||||
m_picker->we_have(index, post_flags);
|
m_picker->we_have(index, post_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void torrent::we_dont_have(int index)
|
||||||
|
{
|
||||||
|
TORRENT_ASSERT(m_ses.is_network_thread());
|
||||||
|
// update m_file_progress
|
||||||
|
TORRENT_ASSERT(m_picker);
|
||||||
|
|
||||||
|
m_picker->we_dont_have(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void torrent::piece_passed(int index, boost::uint32_t post_flags)
|
void torrent::piece_passed(int index, boost::uint32_t post_flags)
|
||||||
{
|
{
|
||||||
// INVARIANT_CHECK;
|
// INVARIANT_CHECK;
|
||||||
|
Loading…
Reference in New Issue
Block a user