Skip to content

Commit de2184f

Browse files
committed
net: get tests working to fix windows build
R=golang-dev CC=golang-dev https://golang.org/cl/4089041
1 parent b7bf2a3 commit de2184f

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/pkg/net/resolv_windows.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,35 @@ func LookupPort(network, service string) (port int, err os.Error) {
7878
return int(syscall.Ntohs(s.Port)), nil
7979
}
8080

81+
// TODO(brainman): Following code is only to get tests running.
82+
8183
func isDomainName(s string) bool {
8284
panic("unimplemented")
8385
}
8486

85-
func resolveaddr(addr string) (arpa string, err os.Error) {
87+
func reverseaddr(addr string) (arpa string, err os.Error) {
8688
panic("unimplemented")
8789
}
90+
91+
// DNSError represents a DNS lookup error.
92+
type DNSError struct {
93+
Error string // description of the error
94+
Name string // name looked for
95+
Server string // server used
96+
IsTimeout bool
97+
}
98+
99+
func (e *DNSError) String() string {
100+
if e == nil {
101+
return "<nil>"
102+
}
103+
s := "lookup " + e.Name
104+
if e.Server != "" {
105+
s += " on " + e.Server
106+
}
107+
s += ": " + e.Error
108+
return s
109+
}
110+
111+
func (e *DNSError) Timeout() bool { return e.IsTimeout }
112+
func (e *DNSError) Temporary() bool { return e.IsTimeout }

0 commit comments

Comments
 (0)