mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-15 18:13:29 +00:00
better stream closing error message
This commit is contained in:
parent
6d75aaff01
commit
e9afae72f0
@ -143,7 +143,7 @@ func (sesh *Session) Accept() (net.Conn, error) {
|
|||||||
|
|
||||||
func (sesh *Session) closeStream(s *Stream, active bool) error {
|
func (sesh *Session) closeStream(s *Stream, active bool) error {
|
||||||
if s.isClosed() {
|
if s.isClosed() {
|
||||||
return errors.New("Already Closed")
|
return fmt.Errorf("stream %v is already closed", s.id)
|
||||||
}
|
}
|
||||||
atomic.StoreUint32(&s.closed, 1)
|
atomic.StoreUint32(&s.closed, 1)
|
||||||
_ = s.recvBuf.Close() // both datagramBuffer and streamBuffer won't return err on Close()
|
_ = s.recvBuf.Close() // both datagramBuffer and streamBuffer won't return err on Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user