forked from I2P_Developers/i2p.i2p
* NetDB:
- Don't instantiate unused success job for republish LS - Add debug setting to encrypt RI lookups
This commit is contained in:
@@ -85,7 +85,8 @@ class IterativeSearchJob extends FloodSearchJob {
|
||||
*/
|
||||
private static final int MAX_CONCURRENT = 1;
|
||||
|
||||
private static final boolean ENCRYPT_RI_SEARCHES = false;
|
||||
/** testing */
|
||||
private static final String PROP_ENCRYPT_RI = "router.encryptRouterLookups";
|
||||
|
||||
public IterativeSearchJob(RouterContext ctx, FloodfillNetworkDatabaseFacade facade, Hash key, Job onFind, Job onFailed, int timeoutMs, boolean isLease) {
|
||||
super(ctx, facade, key, onFind, onFailed, timeoutMs, isLease);
|
||||
@@ -257,7 +258,7 @@ class IterativeSearchJob extends FloodSearchJob {
|
||||
_sentTime.put(peer, Long.valueOf(now));
|
||||
|
||||
I2NPMessage outMsg = null;
|
||||
if (_isLease || ENCRYPT_RI_SEARCHES) {
|
||||
if (_isLease || getContext().getBooleanProperty(PROP_ENCRYPT_RI)) {
|
||||
// Full ElG is fairly expensive so only do it for LS lookups
|
||||
// if we have the ff RI, garlic encrypt it
|
||||
RouterInfo ri = getContext().netDb().lookupRouterInfoLocally(peer);
|
||||
|
@@ -54,7 +54,7 @@ public class RepublishLeaseSetJob extends JobImpl {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Publishing " + ls);
|
||||
getContext().statManager().addRateData("netDb.republishLeaseSetCount", 1, 0);
|
||||
_facade.sendStore(_dest, ls, new OnRepublishSuccess(getContext()), new OnRepublishFailure(getContext(), this), REPUBLISH_LEASESET_TIMEOUT, null);
|
||||
_facade.sendStore(_dest, ls, null, new OnRepublishFailure(getContext(), this), REPUBLISH_LEASESET_TIMEOUT, null);
|
||||
_lastPublished = getContext().clock().now();
|
||||
//getContext().jobQueue().addJob(new StoreJob(getContext(), _facade, _dest, ls, new OnSuccess(getContext()), new OnFailure(getContext()), REPUBLISH_LEASESET_TIMEOUT));
|
||||
}
|
||||
@@ -92,6 +92,7 @@ public class RepublishLeaseSetJob extends JobImpl {
|
||||
}
|
||||
|
||||
/** TODO - does nothing, remove */
|
||||
/****
|
||||
private static class OnRepublishSuccess extends JobImpl {
|
||||
public OnRepublishSuccess(RouterContext ctx) { super(ctx); }
|
||||
public String getName() { return "Publish leaseSet successful"; }
|
||||
@@ -100,7 +101,9 @@ public class RepublishLeaseSetJob extends JobImpl {
|
||||
// _log.debug("successful publishing of the leaseSet for " + _dest.toBase64());
|
||||
}
|
||||
}
|
||||
****/
|
||||
|
||||
/** requeue */
|
||||
private static class OnRepublishFailure extends JobImpl {
|
||||
private RepublishLeaseSetJob _job;
|
||||
public OnRepublishFailure(RouterContext ctx, RepublishLeaseSetJob job) {
|
||||
|
Reference in New Issue
Block a user