return EOF on context done

pull/432/merge
Darien Raymond 2017-04-16 21:31:16 +02:00
parent e274474f25
commit 57a353e92f
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 2 additions and 4 deletions

View File

@ -88,7 +88,7 @@ func (s *Stream) Read() (buf.MultiBuffer, error) {
select {
case <-s.ctx.Done():
return nil, io.ErrClosedPipe
return nil, io.EOF
case <-s.wakeup:
}
}
@ -107,7 +107,7 @@ func (s *Stream) ReadTimeout(timeout time.Duration) (buf.MultiBuffer, error) {
select {
case <-s.ctx.Done():
return nil, io.ErrClosedPipe
return nil, io.EOF
case <-time.After(timeout):
return nil, buf.ErrReadTimeout
case <-s.wakeup:
@ -166,5 +166,3 @@ func (s *Stream) CloseError() {
s.wakeUp()
s.access.Unlock()
}
func (v *Stream) Release() {}