MCPcopy Create free account
hub / github.com/pion/ice / validateSTUNTrafficCache

Method validateSTUNTrafficCache

candidate_base.go:289–302  ·  view source on GitHub ↗
(addr net.Addr)

Source from the content-addressed store, hash-verified

287}
288
289func (c *candidateBase) validateSTUNTrafficCache(addr net.Addr) bool {
290 if candidate, ok := c.remoteCandidateCaches.Load(toAddrPort(addr)); ok {
291 remoteCandidate, ok := candidate.(Candidate)
292 if !ok {
293 return false
294 }
295
296 remoteCandidate.seen(false)
297
298 return true
299 }
300
301 return false
302}
303
304func (c *candidateBase) addRemoteCandidateCache(candidate Candidate, srcAddr net.Addr) {
305 if c.validateSTUNTrafficCache(srcAddr) {

Callers 2

handleInboundPacketMethod · 0.95

Calls 3

toAddrPortFunction · 0.85
LoadMethod · 0.80
seenMethod · 0.65

Tested by

no test coverage detected