I2CP: Run DistributeLocal jobs inline (ticket #1506)

This commit is contained in:
zzz
2015-04-16 14:24:56 +00:00
parent 6e451c8d4d
commit 568c90806d
4 changed files with 14 additions and 3 deletions

View File

@@ -1,3 +1,8 @@
2015-04-16 zzz
* I2CP: Run DistributeLocal jobs inline (ticket #1506)
* i2psnark: Increase max tunnels to 10
* Transport: Fix active peer count for NTCP
2015-04-15 tuna
* SimpleScheduler: Deprecated, functionaltiy moved to SimpleTimer2 (ticket #1069)

View File

@@ -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 = 2;
public final static long BUILD = 3;
/** for example "-test" */
public final static String EXTRA = "";

View File

@@ -476,6 +476,8 @@ class ClientConnectionRunner {
/**
* Asynchronously deliver the message to the current runner
*
* Note that no failure indication is available.
* Fails silently on e.g. queue overflow to client, client dead, etc.
*/
void receiveMessage(Destination toDest, Destination fromDest, Payload payload) {
if (_dead) return;

View File

@@ -299,8 +299,10 @@ class ClientManager {
// sender went away
return;
}
// TODO can we just run this inline instead?
_ctx.jobQueue().addJob(new DistributeLocal(toDest, runner, sender, fromDest, payload, msgId, messageNonce));
// run this inline so we don't clog up the job queue
Job j = new DistributeLocal(toDest, runner, sender, fromDest, payload, msgId, messageNonce);
//_ctx.jobQueue().addJob(j);
j.runJob();
} else {
// remote. w00t
if (_log.shouldLog(Log.DEBUG))
@@ -346,6 +348,8 @@ class ClientManager {
public void runJob() {
_to.receiveMessage(_toDest, _fromDest, _payload);
// note that receiveMessage() does not indicate a failure,
// so a queue overflow is not recognized. we always return success.
if (_from != null) {
_from.updateMessageDeliveryStatus(_msgId, _messageNonce, MessageStatusMessage.STATUS_SEND_SUCCESS_LOCAL);
}