Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for lookupStaticAddr (0.23 sec)

  1. src/net/hosts_test.go

    		}
    	}
    }
    
    func testStaticAddr(t *testing.T, hostsPath string, ent staticHostEntry) {
    	hosts := lookupStaticAddr(ent.in)
    	for i := range ent.out {
    		ent.out[i] = absDomainName(ent.out[i])
    	}
    	if !reflect.DeepEqual(hosts, ent.out) {
    		t.Errorf("%s, lookupStaticAddr(%s) = %v; want %v", hostsPath, ent.in, hosts, ent.out)
    	}
    }
    
    func TestHostCacheModification(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 04 07:21:38 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  2. src/net/hosts.go

    			ipsCp := make([]string, len(byName.addrs))
    			copy(ipsCp, byName.addrs)
    			return ipsCp, byName.canonicalName
    		}
    	}
    	return nil, ""
    }
    
    // lookupStaticAddr looks up the hosts for the given address from /etc/hosts.
    func lookupStaticAddr(addr string) []string {
    	hosts.Lock()
    	defer hosts.Unlock()
    	readHosts()
    	addr = parseLiteralIP(addr)
    	if addr == "" {
    		return nil
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 04 07:21:38 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  3. src/net/dnsclient_unix.go

    func (r *Resolver) goLookupPTR(ctx context.Context, addr string, order hostLookupOrder, conf *dnsConfig) ([]string, error) {
    	if order == hostLookupFiles || order == hostLookupFilesDNS {
    		names := lookupStaticAddr(addr)
    		if len(names) > 0 {
    			return names, nil
    		}
    
    		if order == hostLookupFiles {
    			return nil, newDNSError(errNoSuchHost, addr, "")
    		}
    	}
    
    	arpa, err := reverseaddr(addr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 24.5K bytes
    - Viewed (0)
Back to top