This commit is contained in:
zzz
2011-07-28 18:24:11 +00:00
parent 0d212f6478
commit 59e1fbd0d1
2 changed files with 5 additions and 4 deletions

View File

@ -23,8 +23,7 @@ class FloodOnlyLookupMatchJob extends JobImpl implements ReplyJob {
} }
public void runJob() { public void runJob() {
if ( (getContext().netDb().lookupLeaseSetLocally(_search.getKey()) != null) || if (getContext().netDb().lookupLocally(_search.getKey()) != null) {
(getContext().netDb().lookupRouterInfoLocally(_search.getKey()) != null) ) {
if (_log.shouldLog(Log.INFO)) if (_log.shouldLog(Log.INFO))
_log.info(_search.getJobId() + ": search match and found locally"); _log.info(_search.getJobId() + ": search match and found locally");
_search.success(); _search.success();

View File

@ -190,6 +190,7 @@ class FloodOnlySearchJob extends FloodSearchJob {
failed(); failed();
} }
} }
@Override @Override
public String getName() { return "NetDb flood search (phase 1)"; } public String getName() { return "NetDb flood search (phase 1)"; }
@ -224,11 +225,12 @@ class FloodOnlySearchJob extends FloodSearchJob {
getContext().statManager().addRateData("netDb.failedTime", System.currentTimeMillis()-_created, System.currentTimeMillis()-_created); getContext().statManager().addRateData("netDb.failedTime", System.currentTimeMillis()-_created, System.currentTimeMillis()-_created);
synchronized (_onFailed) { synchronized (_onFailed) {
for (int i = 0; i < _onFailed.size(); i++) { for (int i = 0; i < _onFailed.size(); i++) {
Job j = (Job)_onFailed.remove(0); Job j = _onFailed.remove(0);
getContext().jobQueue().addJob(j); getContext().jobQueue().addJob(j);
} }
} }
} }
@Override @Override
void success() { void success() {
synchronized (this) { synchronized (this) {
@ -255,7 +257,7 @@ class FloodOnlySearchJob extends FloodSearchJob {
getContext().statManager().addRateData("netDb.successTime", System.currentTimeMillis()-_created, System.currentTimeMillis()-_created); getContext().statManager().addRateData("netDb.successTime", System.currentTimeMillis()-_created, System.currentTimeMillis()-_created);
synchronized (_onFind) { synchronized (_onFind) {
while (!_onFind.isEmpty()) while (!_onFind.isEmpty())
getContext().jobQueue().addJob((Job)_onFind.remove(0)); getContext().jobQueue().addJob(_onFind.remove(0));
} }
} }
} }