use we_dont_have to recover from corrupt swarm database.

eventually we will download the pieces again (it works)
This commit is contained in:
Miguel Freitas 2013-12-11 22:17:42 -02:00
parent fd404d0927
commit 8328c7222f

View File

@ -942,6 +942,9 @@ namespace libtorrent
if (ret > 0) { if (ret > 0) {
pieces->push_back( std::string(j.buffer, ret)); pieces->push_back( std::string(j.buffer, ret));
} else {
printf("piece read error (database corrupt?) - setting we_dont_have(%d)\n", j.piece);
m_picker->we_dont_have(j.piece);
} }
(*reqs)--; (*reqs)--;