* i2psnark:

- Set unique tunnel nickname for additional instances
   - Increase page size to 50
   - Restore 1-arg SnarkManager constructor for compatibility
   - Add note about DHT file w/ multiple instances, to be fixed
   - Log tweak
This commit is contained in:
zzz
2013-04-14 14:00:47 +00:00
parent 21e47e61f0
commit 8bfe3f632e
5 changed files with 14 additions and 4 deletions

View File

@ -226,9 +226,9 @@ public class I2PSnarkUtil {
} }
} }
if (opts.getProperty("inbound.nickname") == null) if (opts.getProperty("inbound.nickname") == null)
opts.setProperty("inbound.nickname", "I2PSnark"); opts.setProperty("inbound.nickname", _baseName.replace("i2psnark", "I2PSnark"));
if (opts.getProperty("outbound.nickname") == null) if (opts.getProperty("outbound.nickname") == null)
opts.setProperty("outbound.nickname", "I2PSnark"); opts.setProperty("outbound.nickname", _baseName.replace("i2psnark", "I2PSnark"));
if (opts.getProperty("outbound.priority") == null) if (opts.getProperty("outbound.priority") == null)
opts.setProperty("outbound.priority", "-10"); opts.setProperty("outbound.priority", "-10");
// Dont do this for now, it is set in I2PSocketEepGet for announces, // Dont do this for now, it is set in I2PSocketEepGet for announces,

View File

@ -359,7 +359,7 @@ public class Peer implements Comparable
String bittorrentProtocol = new String(bs, "UTF-8"); String bittorrentProtocol = new String(bs, "UTF-8");
if (!"BitTorrent protocol".equals(bittorrentProtocol)) if (!"BitTorrent protocol".equals(bittorrentProtocol))
throw new IOException("Handshake failure, expected " throw new IOException("Handshake failure, expected "
+ "'Bittorrent protocol', got '" + "'BitTorrent protocol', got '"
+ bittorrentProtocol + "'"); + bittorrentProtocol + "'");
// Handshake read - options // Handshake read - options

View File

@ -131,8 +131,17 @@ public class SnarkManager implements CompleteListener {
public static final String PROP_TRACKERS = "i2psnark.trackers"; public static final String PROP_TRACKERS = "i2psnark.trackers";
/** /**
* For embedded.
*/
public SnarkManager(I2PAppContext ctx) {
this(ctx, "/i2psnark", "i2psnark");
}
/**
* For webapp.
* @param ctxPath generally "/i2psnark" * @param ctxPath generally "/i2psnark"
* @param ctxName generally "i2psnark" * @param ctxName generally "i2psnark"
* @since 0.9.6
*/ */
public SnarkManager(I2PAppContext ctx, String ctxPath, String ctxName) { public SnarkManager(I2PAppContext ctx, String ctxPath, String ctxName) {
_snarks = new ConcurrentHashMap(); _snarks = new ConcurrentHashMap();

View File

@ -57,6 +57,7 @@ abstract class PersistDHT {
} }
/** /**
* TODO - multiple instances overwrite each other
* @param saveAll if true, don't check last seen time * @param saveAll if true, don't check last seen time
*/ */
public static synchronized void saveDHT(DHTNodes nodes, boolean saveAll, File file) { public static synchronized void saveDHT(DHTNodes nodes, boolean saveAll, File file) {

View File

@ -61,7 +61,7 @@ public class I2PSnarkServlet extends BasicServlet {
private static final String DEFAULT_NAME = "i2psnark"; private static final String DEFAULT_NAME = "i2psnark";
public static final String PROP_CONFIG_FILE = "i2psnark.configFile"; public static final String PROP_CONFIG_FILE = "i2psnark.configFile";
private static final int PAGE_SIZE = 20; private static final int PAGE_SIZE = 50;
public I2PSnarkServlet() { public I2PSnarkServlet() {
super(); super();