dnsproxy: Send the correct TTL to our clients
authorArjan van de Ven <arjan@linux.intel.com>
Tue, 10 Jan 2012 00:08:33 +0000 (16:08 -0800)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 10 Jan 2012 12:43:57 +0000 (13:43 +0100)
commita4915bd9cf0cf5bed585385a625390f0d003bef1
tree7dd577956e1386bbe89fdcc69dcbe20cbb9cd78c
parent007cf88321db75c5f86649b73d0376d7c0ae01a6
dnsproxy: Send the correct TTL to our clients

When we send a cached entry to our clients, it won't do to report the TTL
from the original request to our client. The time that an entry has lived
in our cache needs to be subtracted from the TTL that we report to our client.

This patch adds a function to adjust the TTL of a response that we send,
and uses the newly stored "valid_until" value to compute the remaining TTL.
src/dnsproxy.c