From 54f9733ca832eb31f61fc2489b598ec2eecca988 Mon Sep 17 00:00:00 2001 From: xtaci Date: Wed, 31 Aug 2016 14:52:02 +0800 Subject: [PATCH] upd --- stream.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream.go b/stream.go index be03c0a..76a6f2a 100644 --- a/stream.go +++ b/stream.go @@ -59,13 +59,13 @@ READ: select { case <-s.chNotifyReader: goto READ + case <-s.die: + return 0, errors.New("broken pipe") } } // Write implements io.ReadWriteCloser func (s *Stream) Write(b []byte) (n int, err error) { - s.mu.Lock() - defer s.mu.Unlock() frames := s.split(b, cmdPSH, s.id) for k := range frames { bts, _ := frames[k].MarshalBinary()