mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
sshconn: use a generic io.Closer instead of a net.Conn
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -592,7 +592,7 @@ func (c *Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Serve
|
||||
conn.SetDeadline(time.Time{}) //nolint:errcheck
|
||||
go ssh.DiscardRequests(reqs)
|
||||
|
||||
defer conn.Close()
|
||||
defer sconn.Close()
|
||||
|
||||
var user dataprovider.User
|
||||
|
||||
@@ -615,7 +615,7 @@ func (c *Configuration) AcceptInboundConnection(conn net.Conn, config *ssh.Serve
|
||||
|
||||
dataprovider.UpdateLastLogin(&user)
|
||||
|
||||
sshConnection := common.NewSSHConnection(connectionID, conn)
|
||||
sshConnection := common.NewSSHConnection(connectionID, sconn)
|
||||
common.Connections.AddSSHConnection(sshConnection)
|
||||
|
||||
defer common.Connections.RemoveSSHConnection(connectionID)
|
||||
|
||||
Reference in New Issue
Block a user