Rename connClosed -> closed

This commit is contained in:
Davide D'Agostino 2017-05-04 17:46:29 -07:00
parent 7e3820b35d
commit cb362c4101
2 changed files with 6 additions and 5 deletions

View File

@ -81,6 +81,7 @@ func testConn(t *testing.T, disableEPSV bool) {
t.Errorf("'%s'", buf)
}
r.Close()
r.Close() // test we can close two times
}
// Read with deadline

10
ftp.go
View File

@ -47,9 +47,9 @@ type Entry struct {
// Response represents a data-connection
type Response struct {
conn net.Conn
c *ServerConn
connClosed bool
conn net.Conn
c *ServerConn
closed bool
}
// Connect is an alias to Dial, for backward compatibility
@ -538,7 +538,7 @@ func (r *Response) Read(buf []byte) (int, error) {
// Close implements the io.Closer interface on a FTP data connection.
func (r *Response) Close() error {
if r.connClosed {
if r.closed {
return nil
}
err := r.conn.Close()
@ -546,7 +546,7 @@ func (r *Response) Close() error {
if err2 != nil {
err = err2
}
r.connClosed = true
r.closed = true
return err
}