MCPcopy
hub / github.com/AdguardTeam/dnsproxy / cacheForContext

Method cacheForContext

proxy/proxycache.go:9–15  ·  view source on GitHub ↗

cacheForContext returns cache object for the given context.

(d *DNSContext)

Source from the content-addressed store, hash-verified

7
8// cacheForContext returns cache object for the given context.
9func (p *Proxy) cacheForContext(d *DNSContext) (c *cache) {
10 if d.CustomUpstreamConfig != nil && d.CustomUpstreamConfig.cache != nil {
11 return d.CustomUpstreamConfig.cache
12 }
13
14 return p.cache
15}
16
17// replyFromCache tries to get the response from general or subnet cache. In
18// case the cache is present in d, it's used first. Returns true on success.

Callers 2

replyFromCacheMethod · 0.95
cacheRespMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected