RESUME should end cap negotiation without requiring CAP LS

This commit is contained in:
Shivaram Lingamneni 2019-02-09 20:01:47 -05:00
parent fef58bb935
commit 35abe7940a
3 changed files with 67 additions and 68 deletions

View file

@ -127,6 +127,16 @@ func (client *Client) Registered() bool {
return client.registered
}
func (client *Client) SetRegistered() {
// `registered` is only written from the client's own goroutine, but may be
// read from other goroutines; therefore, the client's own goroutine may read
// the value without synchronization, but must write it with synchronization,
// and other goroutines must read it with synchronization
client.stateMutex.Lock()
client.registered = true
client.stateMutex.Unlock()
}
func (client *Client) Destroyed() bool {
client.stateMutex.RLock()
defer client.stateMutex.RUnlock()