BOB config fix, I2CP fix some leaks, see history.txt for details

This commit is contained in:
sponge
2011-02-09 16:15:36 +00:00
parent 467de344b9
commit 99ebad3032
5 changed files with 34 additions and 5 deletions

View File

@@ -120,6 +120,7 @@ public class BOB {
public final static String PROP_CONFIG_LOCATION = "BOB.config";
public final static String PROP_BOB_PORT = "BOB.port";
public final static String PROP_BOB_HOST = "BOB.host";
public final static String PROP_CFG_VER = "BOB.CFG.VER";
private static NamedDB database;
private static Properties props = new Properties();
private static AtomicBoolean spin = new AtomicBoolean(true);
@@ -209,30 +210,41 @@ public class BOB {
// Global router and client API configurations that are missing are set to defaults here.
if (!props.containsKey(I2PClient.PROP_TCP_HOST)) {
props.setProperty(I2PClient.PROP_TCP_HOST, "localhost");
save = true;
}
if (!props.containsKey(I2PClient.PROP_TCP_PORT)) {
props.setProperty(I2PClient.PROP_TCP_PORT, "7654");
}
if (!props.containsKey(I2PClient.PROP_RELIABILITY)) {
props.setProperty(I2PClient.PROP_RELIABILITY, I2PClient.PROP_RELIABILITY_BEST_EFFORT);
save = true;
}
if (!props.containsKey(PROP_BOB_PORT)) {
props.setProperty(PROP_BOB_PORT, "2827"); // 0xB0B
save = true;
}
if (!props.containsKey("inbound.length")) {
props.setProperty("inbound.length", "1");
save = true;
}
if (!props.containsKey("outbound.length")) {
props.setProperty("outbound.length", "1");
save = true;
}
if (!props.containsKey("inbound.lengthVariance")) {
props.setProperty("inbound.lengthVariance", "0");
save = true;
}
if (!props.containsKey("outbound.lengthVariance")) {
props.setProperty("outbound.lengthVariance", "0");
save = true;
}
if (!props.containsKey(PROP_BOB_HOST)) {
props.setProperty(PROP_BOB_HOST, "localhost");
save = true;
}
// PROP_RELIABILITY_NONE, PROP_RELIABILITY_BEST_EFFORT, PROP_RELIABILITY_GUARANTEED
if (!props.containsKey(PROP_CFG_VER)) {
props.setProperty(I2PClient.PROP_RELIABILITY, I2PClient.PROP_RELIABILITY_NONE);
props.setProperty(PROP_CFG_VER,"1");
save = true;
}
if (save) {
File cfg = new File(configLocation);

View File

@@ -197,6 +197,9 @@ public class I2CPMessageReader {
}
}
_stream = null;
_listener = null;
_reader = null;
_readerThread = null;
}
}
}

View File

@@ -11,11 +11,13 @@ import net.i2p.util.I2PThread;
* @since 0.8.3
*/
public class QueuedI2CPMessageReader extends I2CPMessageReader {
private final I2CPMessageQueue in;
private /* final */ I2CPMessageQueue in;
public QueuedI2CPMessageReader(I2CPMessageQueue in, I2CPMessageEventListener lsnr) {
super(lsnr);
this.in = in;
_reader = null;
_readerThread = null;
_reader = new QueuedI2CPMessageReaderRunner();
_readerThread = new I2PThread(_reader, "I2CP Internal Reader " + (++__readerId), true);
}
@@ -57,6 +59,10 @@ public class QueuedI2CPMessageReader extends I2CPMessageReader {
}
}
}
super.run(); // Since we are dead, this will do some clean up, nothing else :-)
in = null;
_readerThread = null;
_reader = null;
}
}
}

View File

@@ -1,3 +1,10 @@
2011-02-09 sponge
* BOB: fixup delivery in config, adds config file versioning.
* I2CP: Fix most of the I2CP leaks. Two leaks remain, but they are small.
net.i2p.internal.QueuedI2CPMessageReader and
net.i2p.router.client.I2CPMessageQueueImpl
are the two remaining leaks.
2011-02-07 zzz
* i2psnark:
- Check for dup magnet torrent when adding torrent file

View File

@@ -17,7 +17,7 @@ import net.i2p.util.Log;
* @since 0.8.3
*/
class QueuedClientConnectionRunner extends ClientConnectionRunner {
private final I2CPMessageQueue queue;
private /* final */ I2CPMessageQueue queue;
/**
* Create a new runner with the given queues
@@ -46,6 +46,7 @@ class QueuedClientConnectionRunner extends ClientConnectionRunner {
void stopRunning() {
super.stopRunning();
queue.close();
queue = null;
}
/**