修复encrypt.Conn释放内存,导致的潜在panic问题.

This commit is contained in:
arraykeys@gmail.com
2018-09-21 12:02:54 +08:00
parent b9afc98230
commit 1b29112a2c

View File

@ -35,13 +35,13 @@ func NewConn(c net.Conn, method, password string) (conn net.Conn, err error) {
}
func (s *Conn) Read(b []byte) (n int, err error) {
if s.r == nil {
return 0, fmt.Errorf("use of closed connection")
return 0, fmt.Errorf("use of closed network connection")
}
return s.r.Read(b)
}
func (s *Conn) Write(b []byte) (n int, err error) {
if s.w == nil {
return 0, fmt.Errorf("use of closed connection")
return 0, fmt.Errorf("use of closed network connection")
}
return s.w.Write(b)
}