Drastically reduces the interface of the FNDS/SNDF, force the use of explicit accessors, refactor FNDS/SNDF

This commit is contained in:
idk
2023-09-19 19:32:00 +00:00
parent 9cad050e6b
commit 92a85b35fe
41 changed files with 470 additions and 1228 deletions

View File

@@ -1335,31 +1335,9 @@ public abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2
_availabilityNotifier.stopNotifying();
closeSocket();
_subsessionMap.clear();
clearOldNetDB();
if (_sessionListener != null) _sessionListener.disconnected(this);
}
private void clearOldNetDB() {
Destination myDest = getMyDestination();
if (myDest != null) {
String base32 = myDest.toBase32();
if (base32 != null) {
String dbid = "clients_"+base32;
// get the netDb directory
File netDbDir = new File(_context.getConfigDir(), "netDb");
File subNetDbDir = new File(netDbDir, dbid);
if (subNetDbDir.exists()) {
subNetDbDir.delete();
}
File baseNetDbDir = new File(_context.getConfigDir(), "netDb");
File baseSubNetDbDir = new File(baseNetDbDir, dbid);
if (baseSubNetDbDir.exists()) {
baseSubNetDbDir.delete();
}
}
}
}
/**
* Close the socket carefully.
*/