Rename connClosed -> closed
This commit is contained in:
parent
7e3820b35d
commit
cb362c4101
@ -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
10
ftp.go
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user