prevent var from being overwritten
This commit is contained in:
parent
d867189400
commit
79f474920a
1 changed files with 5 additions and 4 deletions
|
|
@ -172,14 +172,15 @@ func startPiper(config *piperdConfig, logger *log.Logger) error {
|
|||
logger.Printf("sshpiperd started")
|
||||
|
||||
for {
|
||||
c, err := listener.Accept()
|
||||
conn, err := listener.Accept()
|
||||
if err != nil {
|
||||
logger.Printf("failed to accept connection: %v", err)
|
||||
continue
|
||||
}
|
||||
|
||||
logger.Printf("connection accepted: %v", c.RemoteAddr())
|
||||
go func() {
|
||||
logger.Printf("connection accepted: %v", conn.RemoteAddr())
|
||||
|
||||
go func(c net.Conn) {
|
||||
p, err := ssh.NewSSHPiperConn(c, piper)
|
||||
|
||||
if err != nil {
|
||||
|
|
@ -201,6 +202,6 @@ func startPiper(config *piperdConfig, logger *log.Logger) error {
|
|||
|
||||
err = p.Wait()
|
||||
logger.Printf("connection from %v closed reason: %v", c.RemoteAddr(), err)
|
||||
}()
|
||||
}(conn)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue