forked from I2P_Developers/i2p.i2p
* NetDB: Fix cases where corrupt RouterInfo files were not deleted (ticket #1190)
This commit is contained in:
@@ -478,7 +478,7 @@ class PersistentDataStore extends TransientDataStore {
|
||||
if (!shouldRead()) return;
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Reading " + _routerFile);
|
||||
try {
|
||||
|
||||
InputStream fis = null;
|
||||
boolean corrupt = false;
|
||||
try {
|
||||
@@ -519,14 +519,14 @@ class PersistentDataStore extends TransientDataStore {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Error reading the routerInfo from " + _routerFile.getName(), dfe);
|
||||
corrupt = true;
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Unable to read the router reference in " + _routerFile.getName(), ioe);
|
||||
corrupt = true;
|
||||
} finally {
|
||||
if (fis != null) try { fis.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
if (corrupt) _routerFile.delete();
|
||||
} catch (IOException ioe) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Unable to read the router reference in " + _routerFile.getName(), ioe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user