mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-09 19:52:31 +00:00
* Discard dht cache if it is corrupt, instead of killing rtorrent.
* Minor fixes to the configure script. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1120 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -73,8 +73,12 @@ DhtManager::load_dht_cache() {
|
||||
if (cache_file.is_open()) {
|
||||
cache_file >> cache;
|
||||
|
||||
if (cache_file.fail())
|
||||
throw torrent::input_error("Invalid DHT cache.");
|
||||
// If the cache file is corrupted we will just discard it with an
|
||||
// error message.
|
||||
if (cache_file.fail()) {
|
||||
control->core()->push_log("DHT warning: Cache file corrupted, discarding.");
|
||||
cache = torrent::Object::create_map();
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user