From 5d6edad9d4ccc800b3475cee99e9edc44bab2c41 Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 30 Dec 2010 13:18:22 +0000 Subject: [PATCH] * I2CP: - Include the Hash in the DestReplyMessage on a failed lookup so the client may correlate replies (file omitted from previous checkin) --- .../src/net/i2p/router/client/LookupDestJob.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/router/java/src/net/i2p/router/client/LookupDestJob.java b/router/java/src/net/i2p/router/client/LookupDestJob.java index 68edbcaa0..7db546e91 100644 --- a/router/java/src/net/i2p/router/client/LookupDestJob.java +++ b/router/java/src/net/i2p/router/client/LookupDestJob.java @@ -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) {} + } }