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")
|
logger.Printf("sshpiperd started")
|
||||||
|
|
||||||
for {
|
for {
|
||||||
c, err := listener.Accept()
|
conn, err := listener.Accept()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Printf("failed to accept connection: %v", err)
|
logger.Printf("failed to accept connection: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Printf("connection accepted: %v", c.RemoteAddr())
|
logger.Printf("connection accepted: %v", conn.RemoteAddr())
|
||||||
go func() {
|
|
||||||
|
go func(c net.Conn) {
|
||||||
p, err := ssh.NewSSHPiperConn(c, piper)
|
p, err := ssh.NewSSHPiperConn(c, piper)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -201,6 +202,6 @@ func startPiper(config *piperdConfig, logger *log.Logger) error {
|
||||||
|
|
||||||
err = p.Wait()
|
err = p.Wait()
|
||||||
logger.Printf("connection from %v closed reason: %v", c.RemoteAddr(), err)
|
logger.Printf("connection from %v closed reason: %v", c.RemoteAddr(), err)
|
||||||
}()
|
}(conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue