mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-06 10:12:30 +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:
+1
-1
@@ -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(
|
||||
|
||||
@@ -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