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
This commit is contained in:
@ -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--;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -52,22 +52,32 @@
|
||||
<li>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.
|
||||
<li>Now it's time to add your eepsite to I2P's most popular address book.
|
||||
To do that, you must to tell <a href="http://orion.i2p/">orion.i2p</a>
|
||||
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 <a href="http://orion.i2p/list/">here</a>.
|
||||
<li>Now it's time to add your eepsite to an I2P address book
|
||||
such as <a href="http://orion.i2p/">orion.i2p</a> or
|
||||
<a href="http://trevorreznik.i2p/">trevorreznik.i2p</a>.
|
||||
That is, you must enter
|
||||
your eepsite name and key into a web interface on one or more of these sites.
|
||||
Here is <a href="http://orion.i2p/list/">the key entry form at orion.i2p</a> and
|
||||
here is <a href="http://trevorreznik.i2p/host-database/">the key entry form at trevorreznik.i2p</a>.
|
||||
Again, your key is the entire "Local destination" key on the
|
||||
<a href="http://localhost:7657/i2ptunnel/edit.jsp?tunnel=3">eepsite i2ptunnel configuration page</a>.
|
||||
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 <i>something</i>.i2p into their browser.
|
||||
<li>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/<i>something</i>.i2p into your browser.
|
||||
<li>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 <a href="http://localhost:7657/susidns/subscriptions.jsp">subscriptions configuration page</a>
|
||||
and add <a href="http://orion.i2p/hosts.txt">http://orion.i2p/hosts.txt</a> and/or
|
||||
<a href="http://trevorreznik.i2p/hosts.txt">http://trevorreznik.i2p/hosts.txt</a> to the list and hit "Save".
|
||||
Now you will get updates too!
|
||||
<li>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/<i>something</i>.i2p
|
||||
or http://trevorreznik.i2p/cgi-bin/jump.php?hostname=<i>something</i>.i2p/ into your browser.
|
||||
Once it's working, then you can tell others to use it.
|
||||
<li>Some people check <a href="http://orion.i2p/list/">orion.i2p/list/</a> for new eepsites, so you may start getting
|
||||
<li>Some people check <a href="http://orion.i2p/list/">orion.i2p/list/</a> and
|
||||
<a href="http://inproxy.tino.i2p/status.php">inproxy.tino.i2p/status.php</a> 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:
|
||||
<ul>
|
||||
<li>Post a message on the <a href="http://forum.i2p/viewforum.php?f=16">Eepsite announce forum</a>
|
||||
@ -78,9 +88,10 @@
|
||||
</ul>
|
||||
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 <a href="http://orion.i2p/list/">orion page here</a>,
|
||||
tested it using http://orion.i2p/jump/<i>something</i>.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 <a href="http://orion.i2p/list/">orion</a> or
|
||||
<a href="http://trevorreznik.i2p/host-database/">trevorreznik</a>,
|
||||
tested it using a jump service, and waited 24 hours for the
|
||||
address book update to propagate to others, that shouldn't be necessary.
|
||||
<li>If you have any questions try IRC #i2p or the
|
||||
<a href="http://forum.i2p/viewforum.php?f=10">technical problems section</a> on
|
||||
<a href="http://forum.i2p/">forum.i2p</a>.
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user