|
|
@ -180,18 +180,19 @@ func main() { |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
err := client.SshConn.Wait() |
|
|
|
err := client.SshConn.Wait() |
|
|
|
client.ListenMutex.Lock() |
|
|
|
client.ListenMutex.Lock() |
|
|
|
|
|
|
|
defer client.ListenMutex.Unlock() |
|
|
|
client.Stopping = true |
|
|
|
client.Stopping = true |
|
|
|
|
|
|
|
|
|
|
|
if *verbose { |
|
|
|
if *verbose { |
|
|
|
log.Printf("[%s] SSH connection closed: %s", client.Name, err) |
|
|
|
log.Printf("[%s] SSH connection closed: %s", client.Name, err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for bind, listener := range client.Listeners { |
|
|
|
for bind, listener := range client.Listeners { |
|
|
|
if *verbose { |
|
|
|
if *verbose { |
|
|
|
log.Printf("[%s] Closing listener bound to %s", client.Name, bind) |
|
|
|
log.Printf("[%s] Closing listener bound to %s", client.Name, bind) |
|
|
|
} |
|
|
|
} |
|
|
|
listener.Close() |
|
|
|
listener.Close() |
|
|
|
} |
|
|
|
} |
|
|
|
client.ListenMutex.Unlock() |
|
|
|
|
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|
// Accept requests & channels
|
|
|
|
// Accept requests & channels
|
|
|
|