|
|
@ -20,6 +20,11 @@ var SSHLogLevel = ERROR
|
|
|
|
|
|
|
|
|
|
|
|
// PipeAndClose pipe the data between c and s, close both when done
|
|
|
|
// PipeAndClose pipe the data between c and s, close both when done
|
|
|
|
func PipeAndClose(c io.ReadWriteCloser, s io.ReadWriteCloser) {
|
|
|
|
func PipeAndClose(c io.ReadWriteCloser, s io.ReadWriteCloser) {
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
log.Printf("recovered: %+v", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
defer c.Close()
|
|
|
|
defer c.Close()
|
|
|
|
defer s.Close()
|
|
|
|
defer s.Close()
|
|
|
|
cc := make(chan struct{}, 2)
|
|
|
|
cc := make(chan struct{}, 2)
|
|
|
|