mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Improve extra response records
This commit is contained in:
parent
8a55b6a30d
commit
6dba38ce42
1 changed files with 5 additions and 2 deletions
|
@ -308,9 +308,12 @@ func (rrCache *RRCache) GetExtraRRs(ctx context.Context, query *dns.Msg) (extra
|
|||
}
|
||||
|
||||
// Add expiry and cache information.
|
||||
if rrCache.Expired() {
|
||||
switch {
|
||||
case rrCache.Expires == 0:
|
||||
extra = addExtra(ctx, extra, "record does not expire")
|
||||
case rrCache.Expired():
|
||||
extra = addExtra(ctx, extra, fmt.Sprintf("record expired since %s", time.Since(time.Unix(rrCache.Expires, 0)).Round(time.Second)))
|
||||
} else {
|
||||
default:
|
||||
extra = addExtra(ctx, extra, fmt.Sprintf("record valid for %s", time.Until(time.Unix(rrCache.Expires, 0)).Round(time.Second)))
|
||||
}
|
||||
if rrCache.RequestingNew {
|
||||
|
|
Loading…
Add table
Reference in a new issue