Skip to content

Commit

Permalink
return io.EOF when cmdRST arrives
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Nov 8, 2016
1 parent ee8b5b5 commit 60c611f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion session.go
Expand Up @@ -16,7 +16,6 @@ const (

const (
errBrokenPipe = "broken pipe"
errConnReset = "connection reset by peer"
errInvalidProtocol = "invalid protocol version"
)

Expand Down
3 changes: 2 additions & 1 deletion stream.go
Expand Up @@ -2,6 +2,7 @@ package smux

import (
"bytes"
"io"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -61,7 +62,7 @@ READ:
return n, nil
} else if atomic.LoadInt32(&s.rstflag) == 1 {
_ = s.Close()
return 0, errors.New(errConnReset)
return 0, io.EOF
}

select {
Expand Down

0 comments on commit 60c611f

Please sign in to comment.