Skip to content

Commit

Permalink
Prevent Read on a closed stream
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed Feb 6, 2015
1 parent 9feabe6 commit 912e296
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func (s *Stream) Read(b []byte) (n int, err error) {
START:
s.stateLock.Lock()
switch s.state {
case streamLocalClose:
fallthrough
case streamRemoteClose:
fallthrough
case streamClosed:
Expand Down

0 comments on commit 912e296

Please sign in to comment.