summaryrefslogtreecommitdiff
path: root/libgo/go/net/ipsock.go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-21 07:03:38 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-11-21 07:03:38 +0000
commit79a796b7d3db5d100eedfc774954a6b44944363a (patch)
tree72455aea0286937aa08cc141e5efc800e4626577 /libgo/go/net/ipsock.go
parent7224cf54b3af2b931fb83af65f9cfab5c1df814a (diff)
downloadgcc-79a796b7d3db5d100eedfc774954a6b44944363a.tar.gz
libgo: Update to current version of master library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193688 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/net/ipsock.go')
-rw-r--r--libgo/go/net/ipsock.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/libgo/go/net/ipsock.go b/libgo/go/net/ipsock.go
index 84547c7a6a8..9d48e8c1036 100644
--- a/libgo/go/net/ipsock.go
+++ b/libgo/go/net/ipsock.go
@@ -6,7 +6,14 @@
package net
-var supportsIPv6, supportsIPv4map = probeIPv6Stack()
+import "time"
+
+var supportsIPv6, supportsIPv4map bool
+
+func init() {
+ sysInit()
+ supportsIPv6, supportsIPv4map = probeIPv6Stack()
+}
func firstFavoriteAddr(filter func(IP) IP, addrs []string) (addr IP) {
if filter == nil {
@@ -98,7 +105,7 @@ func JoinHostPort(host, port string) string {
}
// Convert "host:port" into IP address and port.
-func hostPortToIP(net, hostport string) (ip IP, iport int, err error) {
+func hostPortToIP(net, hostport string, deadline time.Time) (ip IP, iport int, err error) {
host, port, err := SplitHostPort(hostport)
if err != nil {
return nil, 0, err
@@ -117,7 +124,7 @@ func hostPortToIP(net, hostport string) (ip IP, iport int, err error) {
filter = ipv6only
}
// Not an IP address. Try as a DNS name.
- addrs, err := LookupHost(host)
+ addrs, err := lookupHostDeadline(host, deadline)
if err != nil {
return nil, 0, err
}