From 8328c7222fdffcba1cea1dd05f77bcd50ceae50e Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Wed, 11 Dec 2013 22:17:42 -0200 Subject: [PATCH] use we_dont_have to recover from corrupt swarm database. eventually we will download the pieces again (it works) --- libtorrent/src/torrent.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index 8dc3a91d..2cd04592 100644 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -942,6 +942,9 @@ namespace libtorrent if (ret > 0) { 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)--;