Skip to content

Commit 6ecbad7

Browse files
committed
client: drop Client.tls
This is unused.
1 parent 4e0e400 commit 6ecbad7

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

client.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ import (
2323
type Client struct {
2424
// keep a reference to the connection so it can be used to create a TLS
2525
// connection later
26-
conn net.Conn
27-
text *textproto.Conn
28-
// whether the Client is using TLS
29-
tls bool
26+
conn net.Conn
27+
text *textproto.Conn
3028
serverName string
3129
lmtp bool
3230
// map of supported extensions
@@ -138,9 +136,6 @@ func (c *Client) setConn(conn net.Conn) {
138136
Closer: conn,
139137
}
140138
c.text = textproto.NewConn(rwc)
141-
142-
_, isTLS := conn.(*tls.Conn)
143-
c.tls = isTLS
144139
}
145140

146141
// Close closes the connection.

client_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func TestClientAuthTrimSpace(t *testing.T) {
3434
&wrote,
3535
}
3636
c := NewClient(fake)
37-
c.tls = true
3837
c.didHello = true
3938
c.Auth(toServerEmptyAuth{})
4039
c.Close()
@@ -110,8 +109,6 @@ func TestBasic(t *testing.T) {
110109
t.Fatalf("Second VRFY: expected verification, got %s", err)
111110
}
112111

113-
// fake TLS so authentication won't complain
114-
c.tls = true
115112
c.serverName = "smtp.google.com"
116113
if err := c.Auth(sasl.NewPlainClient("", "user", "pass")); err != nil {
117114
t.Fatalf("AUTH failed: %s", err)
@@ -428,7 +425,6 @@ func TestHello(t *testing.T) {
428425
case 2:
429426
err = c.Verify("test@example.com")
430427
case 3:
431-
c.tls = true
432428
c.serverName = "smtp.google.com"
433429
err = c.Auth(sasl.NewPlainClient("", "user", "pass"))
434430
case 4:
@@ -538,7 +534,6 @@ func TestAuthFailed(t *testing.T) {
538534
c := NewClient(fake)
539535
defer c.Close()
540536

541-
c.tls = true
542537
c.serverName = "smtp.google.com"
543538
err := c.Auth(sasl.NewPlainClient("", "user", "pass"))
544539

0 commit comments

Comments
 (0)