fix: anytls stream read error (#1970)

Co-authored-by: anytls <anytls>
This commit is contained in:
anytls 2025-04-09 10:55:53 +09:00 committed by wwqgtxx
parent a6c0c02e0d
commit 8752f80595

View file

@ -40,7 +40,7 @@ func newStream(id uint32, sess *Session) *Stream {
// Read implements net.Conn
func (s *Stream) Read(b []byte) (n int, err error) {
n, err = s.pipeR.Read(b)
if s.dieErr != nil {
if n == 0 && s.dieErr != nil {
err = s.dieErr
}
return