mirror of
https://github.com/xtaci/smux.git
synced 2024-04-21 10:51:48 +00:00
fix
This commit is contained in:
@@ -51,7 +51,7 @@ func VerifyConfig(config *Config) error {
|
||||
return errors.New("max frame size must not be larger than 65535")
|
||||
}
|
||||
if config.MaxReceiveBuffer <= 0 {
|
||||
return errors.New("max frame tokens must be positive")
|
||||
return errors.New("max receive buffer must be positive")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
+2
-1
@@ -279,7 +279,8 @@ func (s *Session) keepalive() {
|
||||
case <-tickerPing.C:
|
||||
s.writeFrame(newFrame(cmdNOP, 0))
|
||||
case <-tickerTimeout.C:
|
||||
if !atomic.CompareAndSwapInt32(&s.dataReady, 1, 0) {
|
||||
if !atomic.CompareAndSwapInt32(&s.dataReady, 1, 0) &&
|
||||
int(atomic.LoadInt32(&s.bucket)) == s.config.MaxReceiveBuffer {
|
||||
s.Close()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user