Skip to content

Commit d1836e6

Browse files
Tim Cooperbradfitz
Tim Cooper
authored andcommitted
crypto/tls: remove unneeded calls to bytes.NewReader
Updates #28269 Change-Id: Iae765f85e6ae49f4b581161ed489b2f5ee27cdba Reviewed-on: https://go-review.googlesource.com/c/145737 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 7b0fa52 commit d1836e6

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/crypto/tls/tls.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ package tls
1111
// https://www.imperialviolet.org/2013/02/04/luckythirteen.html.
1212

1313
import (
14-
"bytes"
1514
"crypto"
1615
"crypto/ecdsa"
1716
"crypto/rsa"
@@ -30,21 +29,15 @@ import (
3029
// The configuration config must be non-nil and must include
3130
// at least one certificate or else set GetCertificate.
3231
func Server(conn net.Conn, config *Config) *Conn {
33-
return &Conn{
34-
conn: conn, config: config,
35-
input: *bytes.NewReader(nil), // Issue 28269
36-
}
32+
return &Conn{conn: conn, config: config}
3733
}
3834

3935
// Client returns a new TLS client side connection
4036
// using conn as the underlying transport.
4137
// The config cannot be nil: users must set either ServerName or
4238
// InsecureSkipVerify in the config.
4339
func Client(conn net.Conn, config *Config) *Conn {
44-
return &Conn{
45-
conn: conn, config: config, isClient: true,
46-
input: *bytes.NewReader(nil), // Issue 28269
47-
}
40+
return &Conn{conn: conn, config: config, isClient: true}
4841
}
4942

5043
// A listener implements a network listener (net.Listener) for TLS connections.

0 commit comments

Comments
 (0)