I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 887f953e authored by zzz's avatar zzz
Browse files

* NetDB: Fix cases where corrupt RouterInfo files were not deleted (ticket #1190)

parent 5e16c42e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment