forked from I2P_Developers/i2p.i2p
propagate from branch 'i2p.i2p' (head db152f1a9e08e80c7bd3b87735b51800e8f4c46f)
to branch 'i2p.i2p.zzz.dhtsnark' (head 9b08b2f47961167d0fee52b6481895c494d410d6)
This commit is contained in:
@ -125,7 +125,7 @@ class PeerCoordinator implements PeerListener
|
||||
/** partial pieces - lock by synching on wantedPieces - TODO store Requests, not PartialPieces */
|
||||
private final List<PartialPiece> partialPieces;
|
||||
|
||||
private boolean halted = false;
|
||||
private volatile boolean halted;
|
||||
|
||||
private final MagnetState magnetState;
|
||||
private final CoordinatorListener listener;
|
||||
@ -429,6 +429,14 @@ class PeerCoordinator implements PeerListener
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 0.9.1
|
||||
*/
|
||||
public void restart() {
|
||||
halted = false;
|
||||
timer.schedule((CHECK_PERIOD / 2) + _random.nextInt((int) CHECK_PERIOD));
|
||||
}
|
||||
|
||||
public void connected(Peer peer)
|
||||
{
|
||||
if (halted)
|
||||
|
@ -553,21 +553,14 @@ public class Snark
|
||||
}
|
||||
|
||||
stopped = false;
|
||||
boolean coordinatorChanged = false;
|
||||
if (coordinator.halted()) {
|
||||
// ok, we have already started and stopped, but the coordinator seems a bit annoying to
|
||||
// restart safely, so lets build a new one to replace the old
|
||||
coordinator.restart();
|
||||
if (_peerCoordinatorSet != null)
|
||||
_peerCoordinatorSet.remove(coordinator);
|
||||
PeerCoordinator newCoord = new PeerCoordinator(_util, id, infoHash, meta, storage, this, this);
|
||||
if (_peerCoordinatorSet != null)
|
||||
_peerCoordinatorSet.add(newCoord);
|
||||
coordinator = newCoord;
|
||||
coordinatorChanged = true;
|
||||
_peerCoordinatorSet.add(coordinator);
|
||||
}
|
||||
if (!trackerclient.started() && !coordinatorChanged) {
|
||||
if (!trackerclient.started()) {
|
||||
trackerclient.start();
|
||||
} else if (trackerclient.halted() || coordinatorChanged) {
|
||||
} else if (trackerclient.halted()) {
|
||||
if (storage != null) {
|
||||
try {
|
||||
storage.reopen(rootDataDir);
|
||||
|
@ -511,7 +511,7 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
|
||||
if (sm == null)
|
||||
return;
|
||||
Properties props = tunnel.getClientOptions();
|
||||
sm.setDefaultOptions(sockMgr.buildOptions(props));
|
||||
sm.setDefaultOptions(sm.buildOptions(props));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -584,7 +584,7 @@ abstract class I2PSessionImpl implements I2PSession, I2CPMessageReader.I2CPMessa
|
||||
} else {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug(getPrefix() + "Message received of type " + message.getType()
|
||||
+ " to be handled by " + handler);
|
||||
+ " to be handled by " + handler.getClass().getSimpleName());
|
||||
handler.handleMessage(message, this);
|
||||
}
|
||||
}
|
||||
|
@ -599,7 +599,6 @@ public class ElGamalAESEngine {
|
||||
//_log.debug("Encrypting AES");
|
||||
if (tagsForDelivery == null) tagsForDelivery = Collections.EMPTY_SET;
|
||||
int size = 2 // sizeof(tags)
|
||||
+ tagsForDelivery.size()
|
||||
+ SessionTag.BYTE_LENGTH*tagsForDelivery.size()
|
||||
+ 4 // payload length
|
||||
+ Hash.HASH_LENGTH
|
||||
|
11
history.txt
11
history.txt
@ -1,3 +1,13 @@
|
||||
2012-06-24 zzz
|
||||
* ElGamalAESEngine: Fix bad size estimate when tags are included,
|
||||
resulting in trailing zeros after the padding
|
||||
in the unencrypted data
|
||||
* i2psnark: Don't create a new PeerCoordinator after restart, as the
|
||||
TrackerClient holds on to the old one and that causes it
|
||||
to not get peers. Possibly fixes ticket #563.
|
||||
* I2PTunnel: Fix NPE on shared client creation, thx kytv
|
||||
* Transport: Add Ethiopia to hidden mode list
|
||||
|
||||
2012-06-21 zzz
|
||||
* I2CP: Make separate message ID counters per-destination, use atomic,
|
||||
increase max (could have caused "local loopback" problems)
|
||||
@ -5,6 +15,7 @@
|
||||
streaming messages don't get split up unnecessarily
|
||||
* OCMOSJ, ElG, Streaming: log tweaks
|
||||
* TunnelInfo: Change msg counter from long to int
|
||||
* TunnelPeerSelectors: Minor refactoring to store context
|
||||
* TunnelPool: Fix bug where a tunnel was marked as reused when it wasn't
|
||||
* TunnelPoolManager: Use one ClientPeerSelector for all pools
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 17;
|
||||
public final static long BUILD = 19;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "";
|
||||
|
@ -21,6 +21,13 @@ import net.i2p.router.ReplyJob;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Send a message directly to another router, i.e. not through a tunnel.
|
||||
* This is safe to run inline via runJob().
|
||||
* If the RouterInfo for the Hash is not found locally, it will
|
||||
* queue a lookup and register itself to be run again when the lookup
|
||||
* succeeds or times out.
|
||||
*/
|
||||
public class SendMessageDirectJob extends JobImpl {
|
||||
private final Log _log;
|
||||
private final I2NPMessage _message;
|
||||
@ -39,9 +46,11 @@ public class SendMessageDirectJob extends JobImpl {
|
||||
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) {
|
||||
this(ctx, message, toPeer, null, null, null, null, timeoutMs, priority);
|
||||
}
|
||||
|
||||
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
|
||||
this(ctx, message, toPeer, null, onSuccess, onFail, selector, timeoutMs, priority);
|
||||
}
|
||||
|
||||
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) {
|
||||
super(ctx);
|
||||
_log = getContext().logManager().getLog(SendMessageDirectJob.class);
|
||||
@ -66,6 +75,7 @@ public class SendMessageDirectJob extends JobImpl {
|
||||
}
|
||||
|
||||
public String getName() { return "Send Message Direct"; }
|
||||
|
||||
public void runJob() {
|
||||
long now = getContext().clock().now();
|
||||
|
||||
|
@ -16,7 +16,7 @@ abstract class BadCountries {
|
||||
// zzz.i2p/topics/969
|
||||
// List created based on the Press Freedom Index. Those countries with a score of higher than 50 are included:
|
||||
// http://en.wikipedia.org/wiki/Press_Freedom_Index
|
||||
// Except:
|
||||
// Except (quote):
|
||||
// I don't really think that is usage of I2P is dangerous in countries from CIS
|
||||
// General situation is really bad (like in Russia) but people here doesn't have problems with Ecnryption usage.
|
||||
|
||||
@ -32,6 +32,7 @@ abstract class BadCountries {
|
||||
/* Democratic Republic of the Congo */ "CD",
|
||||
/* Equatorial Guinea */ "GQ",
|
||||
/* Eritrea */ "ER",
|
||||
/* Ethiopia */ "ET",
|
||||
/* Fiji */ "FJ",
|
||||
/* Honduras */ "HN",
|
||||
/* Iran */ "IR",
|
||||
|
Reference in New Issue
Block a user