mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 06:40:54 +03:00
@@ -23,7 +23,6 @@ type Connection struct {
|
||||
ClientVersion string
|
||||
// Remote address for this connection
|
||||
RemoteAddr net.Addr
|
||||
netConn net.Conn
|
||||
channel ssh.Channel
|
||||
command string
|
||||
}
|
||||
@@ -38,11 +37,6 @@ func (c *Connection) GetRemoteAddress() string {
|
||||
return c.RemoteAddr.String()
|
||||
}
|
||||
|
||||
// SetConnDeadline sets a deadline on the network connection so it will be eventually closed
|
||||
func (c *Connection) SetConnDeadline() {
|
||||
c.netConn.SetDeadline(time.Now().Add(2 * time.Minute)) //nolint:errcheck
|
||||
}
|
||||
|
||||
// GetCommand returns the SSH command, if any
|
||||
func (c *Connection) GetCommand() string {
|
||||
return c.command
|
||||
@@ -413,11 +407,7 @@ func (c *Connection) handleSFTPUploadToExistingFile(pflags sftp.FileOpenFlags, r
|
||||
|
||||
// Disconnect disconnects the client closing the network connection
|
||||
func (c *Connection) Disconnect() error {
|
||||
if c.channel != nil {
|
||||
err := c.channel.Close()
|
||||
c.Log(logger.LevelInfo, "channel close, err: %v", err)
|
||||
}
|
||||
return c.netConn.Close()
|
||||
return c.channel.Close()
|
||||
}
|
||||
|
||||
func getOSOpenFlags(requestFlags sftp.FileOpenFlags) (flags int) {
|
||||
|
||||
Reference in New Issue
Block a user