mirror of
https://github.com/xtaci/smux.git
synced 2024-04-21 10:51:48 +00:00
better handling of token bucket notify
This commit is contained in:
+5
-2
@@ -152,7 +152,6 @@ func (s *Session) Close() (err error) {
|
||||
s.streams[k].sessionClose()
|
||||
}
|
||||
s.streamLock.Unlock()
|
||||
s.notifyBucket()
|
||||
return s.conn.Close()
|
||||
}
|
||||
}
|
||||
@@ -217,7 +216,11 @@ func (s *Session) recvLoop() {
|
||||
|
||||
for {
|
||||
for atomic.LoadInt32(&s.bucket) <= 0 && !s.IsClosed() {
|
||||
<-s.bucketNotify
|
||||
select {
|
||||
case <-s.bucketNotify:
|
||||
case <-s.die:
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// read header first
|
||||
|
||||
Reference in New Issue
Block a user