From 9fe949aa97747209cbee8e56376431168ca868b9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 28 Mar 2011 23:28:42 -0400 Subject: [PATCH] net: drop laddr from Dial, cname from LookupHost; new functions Drop laddr argument from Dial. Drop cname return from LookupHost. Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal. Export SplitHostPort, JoinHostPort. Add AAAA (IPv6) support to host lookups. Preparations for implementing some of the lookups using cgo. ParseCIDR and IP.Equal are logically new in this CL but accidentally snuck into an earlier CL about unused labels that was in the same client. In crypto/tls, drop laddr from Dial to match net. R=golang-dev, dsymonds, adg, rh CC=golang-dev https://golang.org/cl/4244055 --- handshake_client_test.go | 2 +- tls.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/handshake_client_test.go b/handshake_client_test.go index fd1f145..3f91c7a 100644 --- a/handshake_client_test.go +++ b/handshake_client_test.go @@ -50,7 +50,7 @@ func TestRunClient(t *testing.T) { testConfig.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_RC4_128_SHA} - conn, err := Dial("tcp", "", "127.0.0.1:10443", testConfig) + conn, err := Dial("tcp", "127.0.0.1:10443", testConfig) if err != nil { t.Fatal(err) } diff --git a/tls.go b/tls.go index e8290d7..f66449c 100644 --- a/tls.go +++ b/tls.go @@ -87,8 +87,9 @@ func Listen(network, laddr string, config *Config) (*Listener, os.Error) { // Dial interprets a nil configuration as equivalent to // the zero configuration; see the documentation of Config // for the defaults. -func Dial(network, laddr, raddr string, config *Config) (*Conn, os.Error) { - c, err := net.Dial(network, laddr, raddr) +func Dial(network, addr string, config *Config) (*Conn, os.Error) { + raddr := addr + c, err := net.Dial(network, raddr) if err != nil { return nil, err }