Skip to content

Commit 3870ca8

Browse files
committed
dnsx/cacher,intra/common,dns53/ipmapper: m comments
1 parent 8aa9e97 commit 3870ca8

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

intra/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (h *baseHandler) onFlow(localaddr, target netip.AddrPort) (fm *Mark, undidA
192192
} // else: either no known transport or preflow failed
193193

194194
if !hasPre || !hasNewIPs {
195-
log.E("com: %s: onFlow: alg, but no preflow? %t, ips? %t for %v; uid: %s; block!",
195+
log.E("com: %s: onFlow: alg, preflow? %t, ips? %t for %v; uid: %s; block!",
196196
h.proto, hasPre, hasNewIPs, doms, pre)
197197
// either optionsBase (BlockModeNone) or optionsBlock
198198
return fm, undidAlg, "", ""

intra/dns53/ipmapper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ func (m *ipmapper) queryIP2(_ context.Context, network, host, uid string, tid ..
190190
ips = append(ips, ip4...)
191191
ips = append(ips, ip6...)
192192

193-
log.D("ipmapper: host %s => ips (out: %v / in: %v+%v); tids: %s+%s; err4: %v, err6: %v",
194-
host, ips, r4, r6, tid4, tid6, lerr4, lerr6)
193+
log.D("ipmapper: host %s => ips (out: %v / in: %d+%d); tids: %s+%s; err4: %v, err6: %v",
194+
host, ips, len(r4), len(r6), tid4, tid6, lerr4, lerr6)
195195
return ips, nil
196196
}
197197

intra/dnsx/cacher.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,12 @@ func (cb *cache) put(key string, ans *dns.Msg, s *x.DNSSummary) (ok bool) {
265265
log.W("cache: put: cache overflow %d > %d", len(cb.c), cb.size)
266266
}
267267

268-
// ansttl is 0 for synthesized "block" answers (see xdns.BlockTTL)
268+
// 1. ansttl is 0 for synthesized "block" answers (see xdns.BlockTTL)
269+
// 2. for most empty ans (like qtype:65), ansttl is 0
269270
ansttl := time.Duration(xdns.RTtl(ans)) * time.Second
270271
if ansttl < cb.ttl {
271272
ansttl = cb.ttl
272-
} else {
273-
// bump up a bit longer than the ttl
273+
} else { // bump up a bit longer than the ttl
274274
ansttl = ansttl + cb.halflife
275275
}
276276
exp := time.Now().Add(ansttl)

0 commit comments

Comments
 (0)