mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-06-08 00:42:25 +02:00
Send close message when explicitly closing client.
This commit is contained in:
parent
9a473b9bf1
commit
2628735431
|
@ -184,6 +184,12 @@ func (c *Client) Close() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c.mu.Lock()
|
||||||
|
if c.conn != nil {
|
||||||
|
c.conn.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) // nolint
|
||||||
|
}
|
||||||
|
c.mu.Unlock()
|
||||||
|
|
||||||
if atomic.LoadUint32(&c.messageProcessing) == 1 {
|
if atomic.LoadUint32(&c.messageProcessing) == 1 {
|
||||||
// Defer closing
|
// Defer closing
|
||||||
atomic.StoreUint32(&c.closed, 2)
|
atomic.StoreUint32(&c.closed, 2)
|
||||||
|
|
Loading…
Reference in a new issue