- Include the Hash in the DestReplyMessage on a failed lookup
        so the client may correlate replies
        (file omitted from previous checkin)
This commit is contained in:
zzz
2010-12-30 13:18:22 +00:00
parent cc4158a7e1
commit 5d6edad9d4

View File

@ -28,7 +28,8 @@ class LookupDestJob extends JobImpl {
public String getName() { return "LeaseSet Lookup for Client"; }
public void runJob() {
DoneJob done = new DoneJob(getContext());
getContext().netDb().lookupLeaseSet(_hash, done, done, 10*1000);
// TODO add support for specifying the timeout in the lookup message
getContext().netDb().lookupLeaseSet(_hash, done, done, 15*1000);
}
private class DoneJob extends JobImpl {
@ -41,7 +42,7 @@ class LookupDestJob extends JobImpl {
if (ls != null)
returnDest(ls.getDestination());
else
returnDest(null);
returnHash(_hash);
}
}
@ -51,4 +52,15 @@ class LookupDestJob extends JobImpl {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {}
}
/**
* Return the failed hash so the client can correlate replies with requests
* @since 0.8.3
*/
private void returnHash(Hash h) {
DestReplyMessage msg = new DestReplyMessage(h);
try {
_runner.doSend(msg);
} catch (I2CPMessageException ime) {}
}
}