Update Go library to last weekly.

From-SVN: r180552
This commit is contained in:
Ian Lance Taylor 2011-10-26 23:57:58 +00:00
parent e0c39d66d4
commit d8f412571f
537 changed files with 43765 additions and 12999 deletions

View file

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin freebsd linux openbsd
// DNS client: see RFC 1035.
// Has to be linked into package net for Dial.
@ -113,7 +115,7 @@ func convertRR_A(records []dnsRR) []IP {
func convertRR_AAAA(records []dnsRR) []IP {
addrs := make([]IP, len(records))
for i, rr := range records {
a := make(IP, 16)
a := make(IP, IPv6len)
copy(a, rr.(*dnsRR_AAAA).AAAA[:])
addrs[i] = a
}
@ -213,6 +215,18 @@ func goLookupHost(name string) (addrs []string, err os.Error) {
// depending on our lookup code, so that Go and C get the same
// answers.
func goLookupIP(name string) (addrs []IP, err os.Error) {
// Use entries from /etc/hosts if possible.
haddrs := lookupStaticHost(name)
if len(haddrs) > 0 {
for _, haddr := range haddrs {
if ip := ParseIP(haddr); ip != nil {
addrs = append(addrs, ip)
}
}
if len(addrs) > 0 {
return
}
}
onceLoadConfig.Do(loadConfig)
if dnserr != nil || cfg == nil {
err = dnserr