|
@@ -189,8 +189,8 @@ func Join(c Conn, c2 Conn) (int64, int64) {
|
|
|
var wait sync.WaitGroup
|
|
|
|
|
|
pipe := func(to Conn, from Conn, bytesCopied *int64) {
|
|
|
- defer to.CloseRead()
|
|
|
- defer from.CloseRead()
|
|
|
+ defer to.Close()
|
|
|
+ defer from.Close()
|
|
|
defer wait.Done()
|
|
|
|
|
|
var err error
|
|
@@ -208,8 +208,6 @@ func Join(c Conn, c2 Conn) (int64, int64) {
|
|
|
go pipe(c2, c, &toBytes)
|
|
|
c.Info("Joined with connection %s", c2.Id())
|
|
|
wait.Wait()
|
|
|
- c.Close()
|
|
|
- c2.Close()
|
|
|
return fromBytes, toBytes
|
|
|
}
|
|
|
|