diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-09 20:51:16 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-09 20:51:16 +0000 |
commit | 2ebd387eab05c472bd95be08fbf8ce1986d012ab (patch) | |
tree | 64e1feace617cc6d508232460f43670bb612c5e2 /libgo/go | |
parent | 4ab104d3d00f7a9d66af5a153ccbd31ed11d825e (diff) | |
download | gcc-2ebd387eab05c472bd95be08fbf8ce1986d012ab.tar.gz |
net: give C.getaddrinfo a hint that we only want SOCK_STREAM answers
This should be more efficient everywhere, and appears to be
required on Solaris.
Copied from master repository.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201637 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/net/cgo_unix.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libgo/go/net/cgo_unix.go b/libgo/go/net/cgo_unix.go index a4d96a86d12..ce54d827c8e 100644 --- a/libgo/go/net/cgo_unix.go +++ b/libgo/go/net/cgo_unix.go @@ -103,6 +103,7 @@ func cgoLookupIPCNAME(name string) (addrs []IP, cname string, err error, complet var hints syscall.Addrinfo hints.Ai_flags = int32(cgoAddrInfoFlags()) + hints.Ai_socktype = syscall.SOCK_STREAM h := syscall.StringBytePtr(name) syscall.Entersyscall() @@ -130,7 +131,7 @@ func cgoLookupIPCNAME(name string) (addrs []IP, cname string, err error, complet } } for r := res; r != nil; r = r.Ai_next { - // Everything comes back twice, once for UDP and once for TCP. + // We only asked for SOCK_STREAM, but check anyhow. if r.Ai_socktype != syscall.SOCK_STREAM { continue } |