diff --git a/mux.go b/mux.go index 5bf24f5..dff1a98 100644 --- a/mux.go +++ b/mux.go @@ -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 } diff --git a/session.go b/session.go index 09712b7..0ef4b9a 100644 --- a/session.go +++ b/session.go @@ -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 }