2005-08-24 jrandom

* Catch errors with corrupt tunnel messages more gracefully (no need to
      kill the thread and cause an OOM...)
    * Don't skip shitlisted peers for netDb store messages, as they aren't
      necessarily shitlisted by other people (though they probably are).
    * Adjust the netDb store per-peer timeout based on each particular peer's
      profile (timeout = 4x their average netDb store response time)
    * Don't republish leaseSets to *failed* peers - send them to peers who
      replied but just didn't know the value.
    * Set a 5 second timeout on the I2PTunnelHTTPServer reading the client's
      HTTP headers, rather than blocking indefinitely.  HTTP headers should be
      sent entirely within the first streaming packet anyway, so this won't be
      a problem.
    * Don't use the I2PTunnel*Server handler thread pool by default, as it may
      prevent any clients from accessing the server if the handlers get
      blocked by the streaming lib or other issues.
    * Don't overwrite a known status (OK/ERR-Reject/ERR-SymmetricNAT) with
      Unknown.
This commit is contained in:
jrandom
2005-08-24 22:55:25 +00:00
committed by zzz
parent 5ec6dca64d
commit 346faa3de2
14 changed files with 204 additions and 80 deletions

View File

@ -50,6 +50,7 @@ public class RouterInfo extends DataStructureImpl {
private volatile boolean _hashCodeInitialized;
public static final String PROP_NETWORK_ID = "netId";
public static final String PROP_CAPABILITIES = "caps";
public RouterInfo() {
setIdentity(null);
@ -298,6 +299,22 @@ public class RouterInfo extends DataStructureImpl {
}
return -1;
}
/**
* what special capabilities this router offers
*
*/
public String getCapabilities() {
if (_options == null) return "";
String capabilities = null;
synchronized (_options) {
capabilities = _options.getProperty(PROP_CAPABILITIES);
}
if (capabilities != null)
return capabilities;
else
return "";
}
/**
* Get the routing key for the structure using the current modifier in the RoutingKeyGenerator.

View File

@ -66,6 +66,15 @@ public class RateStat {
return rv;
}
public double getLifetimeAverageValue() {
if ( (_rates == null) || (_rates.length <= 0) ) return 0;
return _rates[0].getLifetimeAverageValue();
}
public double getLifetimeEventCount() {
if ( (_rates == null) || (_rates.length <= 0) ) return 0;
return _rates[0].getLifetimeEventCount();
}
public Rate getRate(long period) {
for (int i = 0; i < _rates.length; i++) {
if (_rates[i].getPeriod() == period) return _rates[i];