Save the current config options (returning true if save was
successful, false otherwise)
Note that unlike DataHelper.storeProps(),
this does escape the \r or \n that are unescaped in DataHelper.loadProps().
Scheduler used for after both SYNs have been ACKed and both sides
have closed the stream, but either we haven't ACKed their close or
they haven't ACKed ours.
Begin a kademlia style search for the key specified, which can take up to timeoutMs and
will fire the appropriate jobs on success or timeout (or if the kademlia search completes
without any match)
Begin a kademlia style search for the key specified, which can take up to timeoutMs and
will fire the appropriate jobs on success or timeout (or if the kademlia search completes
without any match)
Unused - called only by FNDF.searchFull() from FloodSearchJob which is overridden - don't use this.
Ok, the initial set of searches to the floodfill peers timed out, lets fall back on the
wider kademlia-style searches
Unused - called only by FloodSearchJob which is overridden - don't use this.
Search for a particular key iteratively until we either find a value or we
run out of peers
Note that this is rarely if ever used directly, and is primary used by the ExploreJob extension.
UNUSED - See FloodfillPeerSelector override
Search through the kbucket set to find the most reliable peers close to the
given key, skipping all of the ones already checked
List will not include our own hash.
Asynchronously send the message as requested in the message and, if the
send is successful, queue up any msg.getOnSendJob job, and register it
with the OutboundMessageRegistry (if it has a reply selector).
Asynchronously send the message as requested in the message and, if the
send is successful, queue up any msg.getOnSendJob job, and register it
with the OutboundMessageRegistry (if it has a reply selector).
Preprocess the messages from the pending list, grouping items startAt
through sendThrough (though only part of the last one may be fully
sent), delivering them through the sender/receiver.
we're (probably) searching for a LeaseSet, so to be (overly) cautious, we're sending
the request out through a tunnel w/ reply back through another tunnel.
Send a new message to the given destination, containing the specified
payload, returning true if the router feels confident that the message
was delivered.
Keep unused inbound session tags around for up to 12 minutes (2 minutes longer than
session tags are used on the outbound side so that no reasonable network lag
can cause failed decrypts)
caveat: this method isn't synchronized with the preparedKey, so don't
try to *change* the key data after already doing some
encryption/decryption (or if you do change it, be sure this object isn't
mid decrypt)
Router to receive and process this clove - the router that will open the
delivery instructions and decide what to do process it locally as an I2NPMessage,
forward it as an I2NPMessage to a router, forward it as an I2NPMessage to a Destination,
or forward it as an I2NPMessage to a tunnel.
If true, the recipient of this clove is requested to send a DeliveryStatusMessage
back via the replyThroughRouter using the getId() value for the status' message Id.
if we are serving as an introducer to them, this is the the tag that
they can publish that, when presented to us, will cause us to send
a relay introduction to the current peer
The FIPS PUB 180-2 standard specifies four secure hash algorithms (SHA-1,
SHA-256, SHA-384 and SHA-512) for computing a condensed representation of
electronic data (message).
SHA1() -
Constructor for class net.i2p.crypto.SHA1
Similar to SimpleTimer.TimedEvent but users must extend instead of implement,
and all schedule and cancel methods are through this class rather than SimpleTimer2.
HTTPS only, non-proxied only, no retries, no min and max size options, no timeout option
Fails on 301 or 302 (doesn't follow redirect)
Fails on self-signed certs (must have a valid cert chain)
public void dropBiggestParticipating() {
List partTunnels = listParticipatingTunnels();
if ((partTunnels == null) || (partTunnels.isEmpty())) {
if (_log.shouldLog(Log.ERROR))
_log.error("Not dropping tunnel, since partTunnels was null or had 0 items!");
return;
}
long periodWithoutDrop = _context.clock().now() - _lastDropTime;
if (periodWithoutDrop < DROP_BASE_INTERVAL) {
if (_log.shouldLog(Log.WARN))
_log.warn("Not dropping tunnel, since last drop was " + periodWithoutDrop + " ms ago!");
return;
}
HopConfig biggest = null;
HopConfig current = null;
long biggestMessages = 0;
long biggestAge = -1;
double biggestRate = 0;
for (int i=0; i 20) && ((biggest == null) || (currentRate > biggestRate))) {
// Update our profile of the biggest
biggest = current;
biggestMessages = currentMessages;
biggestAge = currentAge;
biggestRate = currentRate;
}
}
if (biggest == null) {
if (_log.shouldLog(Log.ERROR))
_log.error("Not dropping tunnel, since no suitable tunnel was found.");
return;
}
if (_log.shouldLog(Log.WARN))
_log.warn("Dropping tunnel with " + biggestRate + " messages/s and " + biggestMessages +
" messages, last drop was " + (periodWithoutDrop / 1000) + " s ago.");
remove(biggest);
_lastDropTime = _context.clock().now() + _context.random().nextInt(DROP_RANDOM_BOOST);
}
Coordinate the management of various frequencies and rates within I2P components,
both allowing central update and retrieval, as well as distributed creation and
use.
Creates a storage from the existing file or directory together
with an appropriate MetaInfo file as can be announced on the
given announce String location.
Writes the props to the file, unsorted (unless props is an OrderedProperties)
Note that this does not escape the \r or \n that are unescaped in loadProps() above.
This value indicates the stratum level of the local clock, with values
defined as follows:
Stratum Meaning
----------------------------------------------
0 unspecified or unavailable
1 primary reference (e.g., radio clock)
2-15 secondary reference (via NTP or SNTP)
16-255 reserved
The receiveStreamId will be set to this when the packet doesn't know
what ID will be assigned by the remote peer (aka this is the initial
synchronize packet)
Compared to a standard I2PTunnel,
this acts like a client on the I2P side (no privkey file)
but a server on the UDP side (sends to a configured host/port)
Compared to a standard I2PTunnel,
this acts like a server on the I2P side (persistent privkey file)
but a client on the UDP side (receives on a configured port)
Construct a SubscriptionList using the urls from locationsFile and, if
available, the etags and last-modified headers loaded from etagsFile and
lastModifiedFile.