From e12a73f3f45e32d5f94db9b97fb169fab06e6583 Mon Sep 17 00:00:00 2001 From: xtaci Date: Thu, 18 Apr 2019 12:14:47 +0800 Subject: [PATCH] handle error in discard --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index 15afaab..1db46dc 100644 --- a/session.go +++ b/session.go @@ -260,7 +260,7 @@ func (s *Session) recvLoop() { atomic.AddInt32(&s.bucket, -int32(written)) stream.notifyReadEvent() } else { // discard - io.CopyN(ioutil.Discard, s.conn, int64(hdr.Length())) + written, err = io.CopyN(ioutil.Discard, s.conn, int64(hdr.Length())) } s.streamLock.Unlock()