* 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:
rakshasa
2009-12-30 01:29:20 +00:00
parent 8987be3001
commit 027edf9dcd
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ AC_LANG_POP(C++)
AC_DEFINE(HAVE_CONFIG_H, 1, true if config.h was included)
AC_DEFINE(USER_AGENT, [std::string(PACKAGE "/" VERSION "/") + torrent::version()], Http user agent)
AC_CHECK_FUNC(posix_memalign)
AC_CHECK_FUNCS(posix_memalign)
TORRENT_CHECK_CACHELINE()
CC_ATTRIBUTE_UNUSED(
+6 -2
View File
@@ -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 {