go/src/net
Brad Fitzpatrick d24f446a90 crypto/tls: add Config.Clone
In Go 1.0, the Config struct consisted only of exported fields.

In Go 1.1, it started to grow private, uncopyable fields (sync.Once,
sync.Mutex, etc).

Ever since, people have been writing their own private Config.Clone
methods, or risking it and doing a language-level shallow copy and
copying the unexported sync variables.

Clean this up and export the Config.clone method as Config.Clone.
This matches the convention of Template.Clone from text/template and
html/template at least.

Fixes #15771
Updates #16228 (needs update in x/net/http2 before fixed)
Updates #16492 (not sure whether @agl wants to do more)

Change-Id: I48c2825d4fef55a75d2f99640a7079c56fce39ca
Reviewed-on: https://go-review.googlesource.com/28075
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-09-01 04:26:12 +00:00
..
http crypto/tls: add Config.Clone 2016-09-01 04:26:12 +00:00
internal/socktest net/internal/socktest: add missing support for AcceptEx 2016-02-21 03:09:25 +00:00
mail net/mail: allow utf-8 in ParseAddress 2016-04-15 13:57:26 +00:00
rpc net/rpc: don't assume b.N > 0 2016-03-18 15:54:55 +00:00
smtp crypto/x509: require a NULL parameters for RSA public keys. 2016-08-17 23:47:18 +00:00
testdata net: use libresolv rules for ndots range and validation 2016-08-17 15:20:24 +00:00
textproto all: single space after period. 2016-03-02 00:13:47 +00:00
url net/url: remove RFC 3986 mention in package comment 2016-05-06 19:27:45 +00:00
addrselect.go all: single space after period. 2016-03-02 00:13:47 +00:00
addrselect_test.go
cgo_android.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_bsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_linux.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_netbsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_openbsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_resnew.go
cgo_resold.go
cgo_socknew.go
cgo_sockold.go
cgo_solaris.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
cgo_stub.go net: use contexts for cgo-based DNS resolution 2016-05-10 15:55:48 +00:00
cgo_unix.go net: use contexts for cgo-based DNS resolution 2016-05-10 15:55:48 +00:00
cgo_unix_test.go net: use contexts for cgo-based DNS resolution 2016-05-10 15:55:48 +00:00
cgo_windows.go
conf.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
conf_netcgo.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
conf_test.go net: fix hostLookupOrder("") 2016-05-05 19:15:38 +00:00
conn_test.go all: fix copy-and-paste errors in tests 2016-05-06 16:56:19 +00:00
dial.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
dial_test.go net: demote TestDialerDualStack to a flaky test 2016-07-17 01:25:19 +00:00
dial_unix_test.go net: prevent cancelation goroutine from adjusting fd timeout after connect 2016-08-02 00:55:45 +00:00
dnsclient.go all: single space after period. 2016-03-02 00:13:47 +00:00
dnsclient_test.go
dnsclient_unix.go net: restore per-query timeout logic 2016-08-29 23:40:48 +00:00
dnsclient_unix_test.go net: restore per-query timeout logic 2016-08-29 23:40:48 +00:00
dnsconfig_unix.go net: use libresolv rules for ndots range and validation 2016-08-17 15:20:24 +00:00
dnsconfig_unix_test.go net: use libresolv rules for ndots range and validation 2016-08-17 15:20:24 +00:00
dnsmsg.go net: remove unneeded tags from dnsRR structs 2016-04-28 21:34:06 +00:00
dnsmsg_test.go net: change t.Error to t.Errorf 2016-08-16 14:35:55 +00:00
dnsname_test.go all: standardize RFC mention format 2016-04-12 21:07:52 +00:00
error_plan9_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
error_posix_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
error_test.go net: deflake TestLookupPort for embedded, security-hardened platforms 2016-05-17 21:51:18 +00:00
error_unix_test.go net: prevent spurious TCP connection setup notification on darwin 2016-03-16 03:09:28 +00:00
error_windows_test.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
example_test.go
external_test.go net: make use of internal/testenv package 2016-04-14 06:13:45 +00:00
fd_mutex.go net: factor out fdMutex-related methods on netFD 2016-04-04 22:31:06 +00:00
fd_mutex_test.go net: make unexposed methods start with lowercase letters 2016-03-17 21:43:41 +00:00
fd_plan9.go net: don't return io.EOF from zero byte reads on Plan 9 2016-05-19 03:50:54 +00:00
fd_poll_nacl.go net: use runtime.Keepalive for *netFD values 2016-08-24 16:57:50 +00:00
fd_poll_runtime.go all: use time.Until where applicable 2016-08-30 01:23:46 +00:00
fd_posix.go
fd_posix_test.go
fd_unix.go net: prevent cancelation goroutine from adjusting fd timeout after connect 2016-08-02 00:55:45 +00:00
fd_windows.go net: use runtime.Keepalive for *netFD values 2016-08-24 16:57:50 +00:00
file.go net: document unimplemented methods and functions 2016-08-23 14:19:39 +00:00
file_plan9.go syscall,os,net: don't use ForkLock in plan9 2016-05-06 16:43:07 +00:00
file_stub.go
file_test.go
file_unix.go
file_windows.go
hook.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
hook_cloexec.go
hook_plan9.go
hook_unix.go net: prevent cancelation goroutine from adjusting fd timeout after connect 2016-08-02 00:55:45 +00:00
hook_windows.go net: add missing aborted connection handling on accept test 2016-02-21 03:32:36 +00:00
hosts.go net: ensure lookupStatic* returns copy of slice to disallow cache corruption. 2016-02-21 16:36:56 +00:00
hosts_test.go net: ensure lookupStatic* returns copy of slice to disallow cache corruption. 2016-02-21 16:36:56 +00:00
interface.go net: document unimplemented methods and functions 2016-08-23 14:19:39 +00:00
interface_bsd.go all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
interface_bsd_test.go net: deflake TestPointToPointInterface and TestInterfaceArrivalAndDeparture 2016-05-14 00:53:51 +00:00
interface_bsdvar.go all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
interface_darwin.go all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
interface_freebsd.go all: rename vendored golang.org/x/net packages to golang_org 2016-07-13 18:35:40 +00:00
interface_linux.go Revert "net: add support for Zone of IPNet" 2016-05-06 00:14:26 +00:00
interface_linux_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
interface_stub.go all: single space after period. 2016-03-02 00:13:47 +00:00
interface_test.go net: golang.org/x/net/route plumbing 2016-05-15 06:24:02 +00:00
interface_unix_test.go net: deflake TestPointToPointInterface and TestInterfaceArrivalAndDeparture 2016-05-14 00:53:51 +00:00
interface_windows.go Revert "net: add support for Zone of IPNet" 2016-05-06 00:14:26 +00:00
interface_windows_test.go
ip.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
ip_test.go all: fix "result not used" vet warnings 2016-08-16 14:15:10 +00:00
iprawsock.go net: document unimplemented methods and functions 2016-08-23 14:19:39 +00:00
iprawsock_plan9.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
iprawsock_posix.go net: fix plan9 after context change, propagate contexts more 2016-04-18 16:30:03 +00:00
iprawsock_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
ipsock.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
ipsock_plan9.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
ipsock_posix.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
ipsock_test.go
listen_test.go net: make use of internal/testenv package 2016-04-14 06:13:45 +00:00
lookup.go net/http, net/http/httptrace: new package for tracing HTTP client requests 2016-04-28 20:56:38 +00:00
lookup_plan9.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
lookup_stub.go net: fix plan9 after context change, propagate contexts more 2016-04-18 16:30:03 +00:00
lookup_test.go net: don't run TestLookupDotsWithLocalSource in short mode 2016-06-14 22:50:09 +00:00
lookup_unix.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
lookup_windows.go net: stop using GetHostByName and GetServByName 2016-04-19 05:53:25 +00:00
lookup_windows_test.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
mac.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
mac_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
main_cloexec_test.go
main_conf_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
main_noconf_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
main_plan9_test.go net: don't call forceCloseSockets in non-TestMain functions 2016-05-30 03:30:14 +00:00
main_posix_test.go
main_test.go net: make use of internal/testenv package 2016-04-14 06:13:45 +00:00
main_unix_test.go net: don't call forceCloseSockets in non-TestMain functions 2016-05-30 03:30:14 +00:00
main_windows_test.go net: don't call forceCloseSockets in non-TestMain functions 2016-05-30 03:30:14 +00:00
mockserver_test.go net: deflake TestDialerDualStack 2016-05-19 14:47:33 +00:00
net.go net: use IPv4/IPv6 reserved address blocks for documentation 2016-05-17 04:02:11 +00:00
net_test.go net: don't return io.EOF from zero byte reads 2016-05-19 01:04:49 +00:00
net_windows_test.go net: skip TestInterfacesWithNetsh if "netsh help" contains no English words 2016-03-30 01:51:23 +00:00
netgo_unix_test.go net: use contexts for cgo-based DNS resolution 2016-05-10 15:55:48 +00:00
nss.go
nss_test.go
packetconn_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
parse.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
parse_test.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
pipe.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
pipe_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
platform_test.go net: make use of internal/testenv package 2016-04-14 06:13:45 +00:00
port.go net: fix looking up port numbers starting with numbers. 2016-04-15 23:11:47 +00:00
port_test.go net: fix looking up port numbers starting with numbers. 2016-04-15 23:11:47 +00:00
port_unix.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
protoconn_test.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sendfile_dragonfly.go all: use new io.SeekFoo constants instead of os.SEEK_FOO 2016-04-13 05:25:23 +00:00
sendfile_freebsd.go all: use new io.SeekFoo constants instead of os.SEEK_FOO 2016-04-13 05:25:23 +00:00
sendfile_linux.go net: make unexposed methods start with lowercase letters 2016-03-17 21:43:41 +00:00
sendfile_solaris.go all: use new io.SeekFoo constants instead of os.SEEK_FOO 2016-04-13 05:25:23 +00:00
sendfile_stub.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sendfile_test.go net: mirror Tom Sawyer in the net package for tests 2016-04-12 22:22:36 +00:00
sendfile_windows.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
server_test.go
sock_bsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sock_cloexec.go
sock_linux.go net: simplify internal dtoi and xtoi funcs 2016-08-17 03:12:29 +00:00
sock_plan9.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sock_posix.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
sock_stub.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sock_windows.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockopt_bsd.go all: single space after period. 2016-03-02 00:13:47 +00:00
sockopt_linux.go all: single space after period. 2016-03-02 00:13:47 +00:00
sockopt_plan9.go net: deduplicate TCP socket code 2016-03-03 04:23:59 +00:00
sockopt_posix.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockopt_solaris.go all: single space after period. 2016-03-02 00:13:47 +00:00
sockopt_stub.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockopt_windows.go all: single space after period. 2016-03-02 00:13:47 +00:00
sockoptip_bsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockoptip_linux.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockoptip_posix.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockoptip_stub.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sockoptip_windows.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
sys_cloexec.go
tcpsock.go net: document unimplemented methods and functions 2016-08-23 14:19:39 +00:00
tcpsock_plan9.go net: fix plan9 after context change, propagate contexts more 2016-04-18 16:30:03 +00:00
tcpsock_posix.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
tcpsock_test.go net: make use of internal/testenv package 2016-04-14 06:13:45 +00:00
tcpsock_unix_test.go net: prevent spurious TCP connection setup notification on darwin 2016-03-16 03:09:28 +00:00
tcpsockopt_darwin.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_dragonfly.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_openbsd.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_plan9.go net: deduplicate TCP socket code 2016-03-03 04:23:59 +00:00
tcpsockopt_posix.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_solaris.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_stub.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_unix.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
tcpsockopt_windows.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
timeout_test.go net: don't leak test helper goroutine in TestAcceptTimeout 2016-06-03 11:39:40 +00:00
udpsock.go net: document unimplemented methods and functions 2016-08-23 14:19:39 +00:00
udpsock_plan9.go net: fix plan9 after context change, propagate contexts more 2016-04-18 16:30:03 +00:00
udpsock_posix.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
udpsock_test.go net: cache IPv6 zone information for applications using IPv6 link-local address 2016-04-15 01:45:27 +00:00
unixsock.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
unixsock_plan9.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
unixsock_posix.go net: context plumbing, add Dialer.DialContext 2016-04-15 22:48:12 +00:00
unixsock_test.go net, runtime: skip flaky tests on OpenBSD 2016-04-06 19:28:24 +00:00