diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerCheckerTask.java b/apps/i2psnark/java/src/org/klomp/snark/PeerCheckerTask.java index a53304e93..7a3294f14 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/PeerCheckerTask.java +++ b/apps/i2psnark/java/src/org/klomp/snark/PeerCheckerTask.java @@ -95,17 +95,14 @@ class PeerCheckerTask extends TimerTask peer.setRateHistory(upload, download); peer.resetCounters(); - if (Snark.debug >= Snark.DEBUG) - { - Snark.debug(peer + ":", Snark.DEBUG); - Snark.debug(" ul: " + upload/KILOPERSECOND - + " dl: " + download/KILOPERSECOND - + " i: " + peer.isInterested() - + " I: " + peer.isInteresting() - + " c: " + peer.isChoking() - + " C: " + peer.isChoked(), - Snark.DEBUG); - } + Snark.debug(peer + ":", Snark.DEBUG); + Snark.debug(" ul: " + upload/KILOPERSECOND + + " dl: " + download/KILOPERSECOND + + " i: " + peer.isInterested() + + " I: " + peer.isInteresting() + + " c: " + peer.isChoking() + + " C: " + peer.isChoked(), + Snark.DEBUG); // If we are at our max uploaders and we have lots of other // interested peers try to make some room. @@ -118,9 +115,8 @@ class PeerCheckerTask extends TimerTask // Check if it still wants pieces from us. if (!peer.isInterested()) { - if (Snark.debug >= Snark.INFO) - Snark.debug("Choke uninterested peer: " + peer, - Snark.INFO); + Snark.debug("Choke uninterested peer: " + peer, + Snark.INFO); peer.setChoking(true); uploaders--; coordinator.uploaders--; @@ -132,8 +128,7 @@ class PeerCheckerTask extends TimerTask else if (peer.isInteresting() && peer.isChoked()) { // If they are choking us make someone else a downloader - if (Snark.debug >= Snark.DEBUG) - Snark.debug("Choke choking peer: " + peer, Snark.DEBUG); + Snark.debug("Choke choking peer: " + peer, Snark.DEBUG); peer.setChoking(true); uploaders--; coordinator.uploaders--; @@ -146,8 +141,7 @@ class PeerCheckerTask extends TimerTask else if (!peer.isInteresting() && !coordinator.completed()) { // If they aren't interesting make someone else a downloader - if (Snark.debug >= Snark.DEBUG) - Snark.debug("Choke uninteresting peer: " + peer, Snark.DEBUG); + Snark.debug("Choke uninteresting peer: " + peer, Snark.DEBUG); peer.setChoking(true); uploaders--; coordinator.uploaders--; @@ -162,9 +156,8 @@ class PeerCheckerTask extends TimerTask && download == 0) { // We are downloading but didn't receive anything... - if (Snark.debug >= Snark.DEBUG) - Snark.debug("Choke downloader that doesn't deliver:" - + peer, Snark.DEBUG); + Snark.debug("Choke downloader that doesn't deliver:" + + peer, Snark.DEBUG); peer.setChoking(true); uploaders--; coordinator.uploaders--; @@ -202,9 +195,8 @@ class PeerCheckerTask extends TimerTask || uploaders > uploadLimit) && worstDownloader != null) { - if (Snark.debug >= Snark.DEBUG) - Snark.debug("Choke worst downloader: " + worstDownloader, - Snark.DEBUG); + Snark.debug("Choke worst downloader: " + worstDownloader, + Snark.DEBUG); worstDownloader.setChoking(true); coordinator.uploaders--; diff --git a/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java b/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java index 33feda9f1..8d884486c 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java +++ b/apps/i2psnark/java/src/org/klomp/snark/PeerCoordinator.java @@ -313,6 +313,9 @@ public class PeerCoordinator implements PeerListener synchronized(peers) { need_more = !peer.isConnected() && peers.size() < MAX_CONNECTIONS; + // Check if we already have this peer before we build the connection + Peer old = peerIDInList(peer.getPeerID(), peers); + need_more = need_more && ((old == null) || (old.getInactiveTime() > 4*60*1000)); } if (need_more) @@ -808,8 +811,8 @@ public class PeerCoordinator implements PeerListener public int allowedUploaders() { if (Snark.overUploadLimit(uploaders)) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("Over limit, uploaders was: " + uploaders); + // if (_log.shouldLog(Log.DEBUG)) + // _log.debug("Over limit, uploaders was: " + uploaders); return uploaders - 1; } else if (uploaders < MAX_UPLOADERS) return uploaders + 1; diff --git a/apps/i2psnark/java/src/org/klomp/snark/Snark.java b/apps/i2psnark/java/src/org/klomp/snark/Snark.java index 0a907f6d3..ad2f4aea0 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/Snark.java +++ b/apps/i2psnark/java/src/org/klomp/snark/Snark.java @@ -63,7 +63,7 @@ public class Snark /** * What level of debug info to show. */ - public static int debug = NOTICE; + //public static int debug = NOTICE; // Whether or not to ask the user for commands while sharing private static boolean command_interpreter = true; @@ -505,6 +505,7 @@ public class Snark int i = 0; while (i < args.length) { +/* if (args[i].equals("--debug")) { debug = INFO; @@ -525,7 +526,7 @@ public class Snark catch (NumberFormatException nfe) { } } } - else if (args[i].equals("--port")) + else */ if (args[i].equals("--port")) { if (args.length - 1 < i + 1) usage("--port needs port number to listen on"); @@ -772,7 +773,7 @@ public class Snark totalUploaders += c.uploaders; } int limit = I2PSnarkUtil.instance().getMaxUploaders(); - Snark.debug("Total uploaders: " + totalUploaders + " Limit: " + limit, Snark.DEBUG); + // Snark.debug("Total uploaders: " + totalUploaders + " Limit: " + limit, Snark.DEBUG); return totalUploaders > limit; } } diff --git a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java index 6d22e4b2d..da03fc39f 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java +++ b/apps/i2psnark/java/src/org/klomp/snark/TrackerClient.java @@ -300,8 +300,7 @@ public class TrackerClient extends I2PThread + "&downloaded=" + downloaded + "&left=" + left + ((event != NO_EVENT) ? ("&event=" + event) : ""); - if (Snark.debug >= Snark.INFO) - Snark.debug("Sending TrackerClient request: " + s, Snark.INFO); + Snark.debug("Sending TrackerClient request: " + s, Snark.INFO); File fetched = I2PSnarkUtil.instance().get(s); if (fetched == null) { @@ -315,8 +314,7 @@ public class TrackerClient extends I2PThread TrackerInfo info = new TrackerInfo(in, coordinator.getID(), coordinator.getMetaInfo()); - if (Snark.debug >= Snark.INFO) - Snark.debug("TrackerClient response: " + info, Snark.INFO); + Snark.debug("TrackerClient response: " + info, Snark.INFO); lastRequestTime = System.currentTimeMillis(); String failure = info.getFailureReason(); diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java index 07d14220f..0ee5b692b 100644 --- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java +++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java @@ -138,8 +138,6 @@ public class I2PSocketManagerFactory { I2PSession session = client.createSession(myPrivateKeyStream, opts); session.connect(); I2PSocketManager sockMgr = createManager(session, opts, "manager"); - if (sockMgr != null) - sockMgr.setDefaultOptions(sockMgr.buildOptions(opts)); return sockMgr; } catch (I2PSessionException ise) { _log.error("Error creating session for socket manager", ise); @@ -199,4 +197,4 @@ public class I2PSocketManagerFactory { } return i2cpPort; } -} \ No newline at end of file +} diff --git a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java index 2c62c0de3..7384a4972 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/I2PSocketManagerFull.java @@ -129,7 +129,7 @@ public class I2PSocketManagerFull implements I2PSocketManager { public long getAcceptTimeout() { return _acceptTimeout; } public void setDefaultOptions(I2PSocketOptions options) { - _defaultOptions = new ConnectionOptions(options); + _defaultOptions = new ConnectionOptions((ConnectionOptions) options); } public I2PSocketOptions getDefaultOptions() { diff --git a/history.txt b/history.txt index 371f4e4ef..27175576e 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,11 @@ -$Id: history.txt,v 1.586 2007-09-09 12:38:54 zzz Exp $ +$Id: history.txt,v 1.587 2007-09-14 20:58:30 zzz Exp $ + +2007-09-18 zzz + * eepsite_index.html: Add links to trevorreznik address book + * streaming lib: Fix SocketManagerFactory to honor options on outbound connections + * streaming lib: Fix setDefaultOptions() when called with a ConnectionOptions parameter + * i2psnark: Don't make outbound connections to already-connected peers + * i2psnark: Debug logging cleanup 2007-09-14 zzz * eepget: Increase header timeout to 45s diff --git a/installer/resources/eepsite_index.html b/installer/resources/eepsite_index.html index 310ecd211..1ee32b8c4 100644 --- a/installer/resources/eepsite_index.html +++ b/installer/resources/eepsite_index.html @@ -52,22 +52,32 @@
  • Before you tell the world about your new eepsite, you should add some content. Go to i2p/eepsite/docroot and copy this document (index.html) to help.html so you can refer to it later. Now edit index.html and add content, pictures, and whatever you would like to share. -
  • Now it's time to add your eepsite to I2P's most popular address book. - To do that, you must to tell orion.i2p - what your eepsite name and key are. Orion has a web interface where you can add a key to the address book. - The key entry form is here. +
  • Now it's time to add your eepsite to an I2P address book + such as orion.i2p or + trevorreznik.i2p. + That is, you must enter + your eepsite name and key into a web interface on one or more of these sites. + Here is the key entry form at orion.i2p and + here is the key entry form at trevorreznik.i2p. Again, your key is the entire "Local destination" key on the eepsite i2ptunnel configuration page. Be sure you get the whole thing, ending with "AAAA". Don't forget to click "add a key". Check to see if it reports the key was added. - Since most routers periodically get address book updates from orion, within several hours others will be able to find your + Since many routers periodically get address book updates from orion or trevorreznik, within several hours others will be able to find your website by simply typing something.i2p into their browser. -
  • If you are in a hurry and can't wait a few hours, you can tell people to use orion's "jump" address helper redirection service. - This will work within a few minutes of your entering the key to orion.i2p. - Test it yourself first by entering http://orion.i2p/jump/something.i2p into your browser. +
  • Speaking of address book updates, this would be a good time to add orion, trevorreznik, or both + to your own subscription list. Go to your subscriptions configuration page + and add http://orion.i2p/hosts.txt and/or + http://trevorreznik.i2p/hosts.txt to the list and hit "Save". + Now you will get updates too! +
  • If you are in a hurry and can't wait a few hours, you can tell people to use a "jump" address helper redirection service. + This will work within a few minutes of your entering the key to an address book. + Test it yourself first by entering http://orion.i2p/jump/something.i2p + or http://trevorreznik.i2p/cgi-bin/jump.php?hostname=something.i2p/ into your browser. Once it's working, then you can tell others to use it. -
  • Some people check orion.i2p/list/ for new eepsites, so you may start getting +
  • Some people check orion.i2p/list/ and + inproxy.tino.i2p/status.php for new eepsites, so you may start getting a few visitors. But there are plenty of other ways to tell people. Here are a few ideas: Note that some sites recommend pasting in that really long destination key. You can if you want - but - if you have successfully posted your key on the orion page here, - tested it using http://orion.i2p/jump/something.i2p, and waited 24 hours for orion's - address book to propagate to others, that shouldn't be necessary. + if you have successfully posted your key at orion or + trevorreznik, + tested it using a jump service, and waited 24 hours for the + address book update to propagate to others, that shouldn't be necessary.
  • If you have any questions try IRC #i2p or the technical problems section on forum.i2p. diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 4e005bb44..20fea7568 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.522 $ $Date: 2007-09-09 12:38:53 $"; + public final static String ID = "$Revision: 1.523 $ $Date: 2007-09-14 20:58:30 $"; public final static String VERSION = "0.6.1.29"; - public final static long BUILD = 4; + public final static long BUILD = 5; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID);