diff options
author | Jason Simmons <jsimmons@google.com> | 2011-09-20 16:02:43 -0700 |
---|---|---|
committer | Jason Simmons <jsimmons@google.com> | 2011-09-20 16:02:43 -0700 |
commit | b99c4f55163e9c4ac6b123f0e8383b9b9072073b (patch) | |
tree | 6852d2279f71679d933491b52f9cb55f0bae66aa /src/javax/jmdns/impl/tasks | |
parent | cc85bd38e82cb6e41288a2bb90f77ba92d79c9d7 (diff) | |
download | jmdns-b99c4f55163e9c4ac6b123f0e8383b9b9072073b.tar.gz |
Revert the change to DNS_TTL and fix the renewer's TTL
In a previous change, DNSConstants.DNS_TTL had been changed to reduce
the TTL of mDNS services advertised by the A@H broker. Instead of
changing this for all users of JmDNS, A@H will use the
DNSStateTask.setDefaultTTL internal API to control the TTL.
Also, patch the Renewer so that the renewal interval is based on the
task's own TTL instead of the hardcoded TTL in DNSConstants.
Change-Id: I9f42b98e8088267b38d380edfd8b2e737d00414e
Diffstat (limited to 'src/javax/jmdns/impl/tasks')
-rw-r--r-- | src/javax/jmdns/impl/tasks/state/Renewer.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/javax/jmdns/impl/tasks/state/Renewer.java b/src/javax/jmdns/impl/tasks/state/Renewer.java index 1c638d4..f79ee12 100644 --- a/src/javax/jmdns/impl/tasks/state/Renewer.java +++ b/src/javax/jmdns/impl/tasks/state/Renewer.java @@ -54,7 +54,10 @@ public class Renewer extends DNSStateTask { @Override public void start(Timer timer) { if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { - timer.schedule(this, DNSConstants.ANNOUNCED_RENEWAL_TTL_INTERVAL, DNSConstants.ANNOUNCED_RENEWAL_TTL_INTERVAL); + // BEGIN android-changed + // Schedule the renewer based on this task's TTL, not the default TTL + timer.schedule(this, getTTL() * 500, getTTL() * 500); + // END android-changed } } |