fix closing scheme

This commit is contained in:
xtaci
2019-12-19 14:52:45 +08:00
parent 4f88883837
commit f3cccbb51c
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -71,10 +71,11 @@ func handleClient(mux generic.Mux, p1 net.Conn, ctrl *generic.CopyControl, quiet
}
}
}
p1.Close()
p2.Close()
}
go streamCopy(p1, p2)
// errors reading from p1(net.Conn) can close p2 while return
streamCopy(p2, p1)
}
+2 -1
View File
@@ -138,10 +138,11 @@ func handleClient(p1 io.ReadWriteCloser, p2 net.Conn, ctrl *generic.CopyControl,
}
}
}
p1.Close()
p2.Close()
}
go streamCopy(p2, p1)
// errors reading from p2(net.Conn) can close p1 while return
streamCopy(p1, p2)
}