* Throttle: Set a default router.maxParticipatingTunnels = 3000 (was none)

* Stats: Add a fake uptime if not publishing stats, to get participating tunnels
    * build.xml:
      - Add an updateSmall target which includes only the essentials
      - Clean up the build file some 
      - Remove empty eepsite/ and subdirs from i2pupdate.zip
    * configtunnels.jsp: Add warning
    * i2psnark: Catch a bencode exception (bad peer from tracker) earlier
    * i2psnark-standalone: Fix exception http://forum.i2p/viewtopic.php?p=12217
This commit is contained in:
zzz
2008-05-26 13:13:26 +00:00
parent 955e7823ad
commit 2f72f5ca67
8 changed files with 74 additions and 72 deletions

View File

@ -118,10 +118,14 @@ public class SnarkManager implements Snark.CompleteListener {
if (!_config.containsKey(PROP_UPLOADERS_TOTAL))
_config.setProperty(PROP_UPLOADERS_TOTAL, "" + Snark.MAX_TOTAL_UPLOADERS);
if (!_config.containsKey(PROP_UPBW_MAX)) {
if (_context instanceof RouterContext)
_config.setProperty(PROP_UPBW_MAX, "" + (((RouterContext)_context).bandwidthLimiter().getOutboundKBytesPerSecond() / 2));
else
try {
if (_context instanceof RouterContext)
_config.setProperty(PROP_UPBW_MAX, "" + (((RouterContext)_context).bandwidthLimiter().getOutboundKBytesPerSecond() / 2));
else
_config.setProperty(PROP_UPBW_MAX, "" + DEFAULT_MAX_UP_BW);
} catch (NoClassDefFoundError ncdfe) {
_config.setProperty(PROP_UPBW_MAX, "" + DEFAULT_MAX_UP_BW);
}
}
if (!_config.containsKey(PROP_DIR))
_config.setProperty(PROP_DIR, "i2psnark");

View File

@ -95,7 +95,14 @@ public class TrackerInfo
Iterator it = l.iterator();
while (it.hasNext())
{
PeerID peerID = new PeerID(((BEValue)it.next()).getMap());
PeerID peerID;
try {
peerID = new PeerID(((BEValue)it.next()).getMap());
} catch (InvalidBEncodingException ibe) {
// don't let one bad entry spoil the whole list
Snark.debug("Discarding peer from list: " + ibe, Snark.ERROR);
continue;
}
peers.add(new Peer(peerID, my_id, metainfo));
}