Home | History | Annotate | Download | only in net

Lines Matching refs:hosts

30 // hosts contains known host entries.
31 var hosts struct {
55 if now.Before(hosts.expire) && hosts.path == hp && len(hosts.byName) > 0 {
59 if err == nil && hosts.path == hp && hosts.mtime.Equal(mtime) && hosts.size == size {
60 hosts.expire = now.Add(cacheMaxAge)
93 hosts.expire = now.Add(cacheMaxAge)
94 hosts.path = hp
95 hosts.byName = hs
96 hosts.byAddr = is
97 hosts.mtime = mtime
98 hosts.size = size
102 // lookupStaticHost looks up the addresses for the given host from /etc/hosts.
104 hosts.Lock()
105 defer hosts.Unlock()
107 if len(hosts.byName) != 0 {
112 if ips, ok := hosts.byName[absDomainName(lowerHost)]; ok {
121 // lookupStaticAddr looks up the hosts for the given address from /etc/hosts.
123 hosts.Lock()
124 defer hosts.Unlock()
130 if len(hosts.byAddr) != 0 {
131 if hosts, ok := hosts.byAddr[addr]; ok {
132 hostsCp := make([]string, len(hosts))
133 copy(hostsCp, hosts)