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.setRateHistory(upload, download);
|
||||||
peer.resetCounters();
|
peer.resetCounters();
|
||||||
|
|
||||||
if (Snark.debug >= Snark.DEBUG)
|
Snark.debug(peer + ":", Snark.DEBUG);
|
||||||
{
|
Snark.debug(" ul: " + upload/KILOPERSECOND
|
||||||
Snark.debug(peer + ":", Snark.DEBUG);
|
+ " dl: " + download/KILOPERSECOND
|
||||||
Snark.debug(" ul: " + upload/KILOPERSECOND
|
+ " i: " + peer.isInterested()
|
||||||
+ " dl: " + download/KILOPERSECOND
|
+ " I: " + peer.isInteresting()
|
||||||
+ " i: " + peer.isInterested()
|
+ " c: " + peer.isChoking()
|
||||||
+ " I: " + peer.isInteresting()
|
+ " C: " + peer.isChoked(),
|
||||||
+ " c: " + peer.isChoking()
|
Snark.DEBUG);
|
||||||
+ " C: " + peer.isChoked(),
|
|
||||||
Snark.DEBUG);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If we are at our max uploaders and we have lots of other
|
// If we are at our max uploaders and we have lots of other
|
||||||
// interested peers try to make some room.
|
// interested peers try to make some room.
|
||||||
@ -118,9 +115,8 @@ class PeerCheckerTask extends TimerTask
|
|||||||
// Check if it still wants pieces from us.
|
// Check if it still wants pieces from us.
|
||||||
if (!peer.isInterested())
|
if (!peer.isInterested())
|
||||||
{
|
{
|
||||||
if (Snark.debug >= Snark.INFO)
|
Snark.debug("Choke uninterested peer: " + peer,
|
||||||
Snark.debug("Choke uninterested peer: " + peer,
|
Snark.INFO);
|
||||||
Snark.INFO);
|
|
||||||
peer.setChoking(true);
|
peer.setChoking(true);
|
||||||
uploaders--;
|
uploaders--;
|
||||||
coordinator.uploaders--;
|
coordinator.uploaders--;
|
||||||
@ -132,8 +128,7 @@ class PeerCheckerTask extends TimerTask
|
|||||||
else if (peer.isInteresting() && peer.isChoked())
|
else if (peer.isInteresting() && peer.isChoked())
|
||||||
{
|
{
|
||||||
// If they are choking us make someone else a downloader
|
// 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);
|
peer.setChoking(true);
|
||||||
uploaders--;
|
uploaders--;
|
||||||
coordinator.uploaders--;
|
coordinator.uploaders--;
|
||||||
@ -146,8 +141,7 @@ class PeerCheckerTask extends TimerTask
|
|||||||
else if (!peer.isInteresting() && !coordinator.completed())
|
else if (!peer.isInteresting() && !coordinator.completed())
|
||||||
{
|
{
|
||||||
// If they aren't interesting make someone else a downloader
|
// 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);
|
peer.setChoking(true);
|
||||||
uploaders--;
|
uploaders--;
|
||||||
coordinator.uploaders--;
|
coordinator.uploaders--;
|
||||||
@ -162,9 +156,8 @@ class PeerCheckerTask extends TimerTask
|
|||||||
&& download == 0)
|
&& download == 0)
|
||||||
{
|
{
|
||||||
// We are downloading but didn't receive anything...
|
// We are downloading but didn't receive anything...
|
||||||
if (Snark.debug >= Snark.DEBUG)
|
Snark.debug("Choke downloader that doesn't deliver:"
|
||||||
Snark.debug("Choke downloader that doesn't deliver:"
|
+ peer, Snark.DEBUG);
|
||||||
+ peer, Snark.DEBUG);
|
|
||||||
peer.setChoking(true);
|
peer.setChoking(true);
|
||||||
uploaders--;
|
uploaders--;
|
||||||
coordinator.uploaders--;
|
coordinator.uploaders--;
|
||||||
@ -202,9 +195,8 @@ class PeerCheckerTask extends TimerTask
|
|||||||
|| uploaders > uploadLimit)
|
|| uploaders > uploadLimit)
|
||||||
&& worstDownloader != null)
|
&& worstDownloader != null)
|
||||||
{
|
{
|
||||||
if (Snark.debug >= Snark.DEBUG)
|
Snark.debug("Choke worst downloader: " + worstDownloader,
|
||||||
Snark.debug("Choke worst downloader: " + worstDownloader,
|
Snark.DEBUG);
|
||||||
Snark.DEBUG);
|
|
||||||
|
|
||||||
worstDownloader.setChoking(true);
|
worstDownloader.setChoking(true);
|
||||||
coordinator.uploaders--;
|
coordinator.uploaders--;
|
||||||
|
@ -313,6 +313,9 @@ public class PeerCoordinator implements PeerListener
|
|||||||
synchronized(peers)
|
synchronized(peers)
|
||||||
{
|
{
|
||||||
need_more = !peer.isConnected() && peers.size() < MAX_CONNECTIONS;
|
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)
|
if (need_more)
|
||||||
@ -808,8 +811,8 @@ public class PeerCoordinator implements PeerListener
|
|||||||
public int allowedUploaders()
|
public int allowedUploaders()
|
||||||
{
|
{
|
||||||
if (Snark.overUploadLimit(uploaders)) {
|
if (Snark.overUploadLimit(uploaders)) {
|
||||||
if (_log.shouldLog(Log.DEBUG))
|
// if (_log.shouldLog(Log.DEBUG))
|
||||||
_log.debug("Over limit, uploaders was: " + uploaders);
|
// _log.debug("Over limit, uploaders was: " + uploaders);
|
||||||
return uploaders - 1;
|
return uploaders - 1;
|
||||||
} else if (uploaders < MAX_UPLOADERS)
|
} else if (uploaders < MAX_UPLOADERS)
|
||||||
return uploaders + 1;
|
return uploaders + 1;
|
||||||
|
@ -63,7 +63,7 @@ public class Snark
|
|||||||
/**
|
/**
|
||||||
* What level of debug info to show.
|
* 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
|
// Whether or not to ask the user for commands while sharing
|
||||||
private static boolean command_interpreter = true;
|
private static boolean command_interpreter = true;
|
||||||
@ -505,6 +505,7 @@ public class Snark
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < args.length)
|
while (i < args.length)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
if (args[i].equals("--debug"))
|
if (args[i].equals("--debug"))
|
||||||
{
|
{
|
||||||
debug = INFO;
|
debug = INFO;
|
||||||
@ -525,7 +526,7 @@ public class Snark
|
|||||||
catch (NumberFormatException nfe) { }
|
catch (NumberFormatException nfe) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[i].equals("--port"))
|
else */ if (args[i].equals("--port"))
|
||||||
{
|
{
|
||||||
if (args.length - 1 < i + 1)
|
if (args.length - 1 < i + 1)
|
||||||
usage("--port needs port number to listen on");
|
usage("--port needs port number to listen on");
|
||||||
@ -772,7 +773,7 @@ public class Snark
|
|||||||
totalUploaders += c.uploaders;
|
totalUploaders += c.uploaders;
|
||||||
}
|
}
|
||||||
int limit = I2PSnarkUtil.instance().getMaxUploaders();
|
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;
|
return totalUploaders > limit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,8 +300,7 @@ public class TrackerClient extends I2PThread
|
|||||||
+ "&downloaded=" + downloaded
|
+ "&downloaded=" + downloaded
|
||||||
+ "&left=" + left
|
+ "&left=" + left
|
||||||
+ ((event != NO_EVENT) ? ("&event=" + event) : "");
|
+ ((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);
|
File fetched = I2PSnarkUtil.instance().get(s);
|
||||||
if (fetched == null) {
|
if (fetched == null) {
|
||||||
@ -315,8 +314,7 @@ public class TrackerClient extends I2PThread
|
|||||||
|
|
||||||
TrackerInfo info = new TrackerInfo(in, coordinator.getID(),
|
TrackerInfo info = new TrackerInfo(in, coordinator.getID(),
|
||||||
coordinator.getMetaInfo());
|
coordinator.getMetaInfo());
|
||||||
if (Snark.debug >= Snark.INFO)
|
Snark.debug("TrackerClient response: " + info, Snark.INFO);
|
||||||
Snark.debug("TrackerClient response: " + info, Snark.INFO);
|
|
||||||
lastRequestTime = System.currentTimeMillis();
|
lastRequestTime = System.currentTimeMillis();
|
||||||
|
|
||||||
String failure = info.getFailureReason();
|
String failure = info.getFailureReason();
|
||||||
|
@ -138,8 +138,6 @@ public class I2PSocketManagerFactory {
|
|||||||
I2PSession session = client.createSession(myPrivateKeyStream, opts);
|
I2PSession session = client.createSession(myPrivateKeyStream, opts);
|
||||||
session.connect();
|
session.connect();
|
||||||
I2PSocketManager sockMgr = createManager(session, opts, "manager");
|
I2PSocketManager sockMgr = createManager(session, opts, "manager");
|
||||||
if (sockMgr != null)
|
|
||||||
sockMgr.setDefaultOptions(sockMgr.buildOptions(opts));
|
|
||||||
return sockMgr;
|
return sockMgr;
|
||||||
} catch (I2PSessionException ise) {
|
} catch (I2PSessionException ise) {
|
||||||
_log.error("Error creating session for socket manager", ise);
|
_log.error("Error creating session for socket manager", ise);
|
||||||
@ -199,4 +197,4 @@ public class I2PSocketManagerFactory {
|
|||||||
}
|
}
|
||||||
return i2cpPort;
|
return i2cpPort;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
|
|||||||
public long getAcceptTimeout() { return _acceptTimeout; }
|
public long getAcceptTimeout() { return _acceptTimeout; }
|
||||||
|
|
||||||
public void setDefaultOptions(I2PSocketOptions options) {
|
public void setDefaultOptions(I2PSocketOptions options) {
|
||||||
_defaultOptions = new ConnectionOptions(options);
|
_defaultOptions = new ConnectionOptions((ConnectionOptions) options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public I2PSocketOptions getDefaultOptions() {
|
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
|
2007-09-14 zzz
|
||||||
* eepget: Increase header timeout to 45s
|
* 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.
|
<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.
|
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 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.
|
<li>Now it's time to add your eepsite to an I2P address book
|
||||||
To do that, you must to tell <a href="http://orion.i2p/">orion.i2p</a>
|
such as <a href="http://orion.i2p/">orion.i2p</a> or
|
||||||
what your eepsite name and key are. Orion has a web interface where you can add a key to the address book.
|
<a href="http://trevorreznik.i2p/">trevorreznik.i2p</a>.
|
||||||
The key entry form is <a href="http://orion.i2p/list/">here</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
|
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>.
|
<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".
|
Be sure you get the whole thing, ending with "AAAA".
|
||||||
Don't forget to click "add a key".
|
Don't forget to click "add a key".
|
||||||
Check to see if it reports the key was added.
|
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.
|
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.
|
<li>Speaking of address book updates, this would be a good time to add orion, trevorreznik, or both
|
||||||
This will work within a few minutes of your entering the key to orion.i2p.
|
to your own subscription list. Go to your <a href="http://localhost:7657/susidns/subscriptions.jsp">subscriptions configuration page</a>
|
||||||
Test it yourself first by entering http://orion.i2p/jump/<i>something</i>.i2p into your browser.
|
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.
|
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:
|
a few visitors. But there are plenty of other ways to tell people. Here are a few ideas:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Post a message on the <a href="http://forum.i2p/viewforum.php?f=16">Eepsite announce forum</a>
|
<li>Post a message on the <a href="http://forum.i2p/viewforum.php?f=16">Eepsite announce forum</a>
|
||||||
@ -78,9 +88,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
Note that some sites recommend pasting in that really long destination key.
|
Note that some sites recommend pasting in that really long destination key.
|
||||||
You can if you want - but
|
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>,
|
if you have successfully posted your key at <a href="http://orion.i2p/list/">orion</a> or
|
||||||
tested it using http://orion.i2p/jump/<i>something</i>.i2p, and waited 24 hours for orion's
|
<a href="http://trevorreznik.i2p/host-database/">trevorreznik</a>,
|
||||||
address book to propagate to others, that shouldn't be necessary.
|
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
|
<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/viewforum.php?f=10">technical problems section</a> on
|
||||||
<a href="http://forum.i2p/">forum.i2p</a>.
|
<a href="http://forum.i2p/">forum.i2p</a>.
|
||||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class RouterVersion {
|
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 String VERSION = "0.6.1.29";
|
||||||
public final static long BUILD = 4;
|
public final static long BUILD = 5;
|
||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
|
||||||
System.out.println("Router ID: " + RouterVersion.ID);
|
System.out.println("Router ID: " + RouterVersion.ID);
|
||||||
|
Reference in New Issue
Block a user