|
|
@ -2,14 +2,15 @@ package obfssh
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"io"
|
|
|
|
"log"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/fangdingjun/go-log"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
// 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() {
|
|
|
|
defer func() {
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
log.Printf("recovered: %+v", err)
|
|
|
|
log.Errorf("recovered: %+v", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
|
|
|
}()
|
|
|
|
defer c.Close()
|
|
|
|
defer c.Close()
|
|
|
|