mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2024-04-26 11:20:28 +02:00
Fix potential race condition when closing message channel.
This commit is contained in:
parent
7bdff5ddef
commit
618e7b085e
|
@ -185,7 +185,6 @@ func (c *Client) Close() {
|
|||
|
||||
c.closeChan <- true
|
||||
c.messagesDone.Wait()
|
||||
close(c.messageChan)
|
||||
|
||||
c.OnClosed(c)
|
||||
c.SetSession(nil)
|
||||
|
@ -231,6 +230,7 @@ func (c *Client) SendMessage(message WritableClientMessage) bool {
|
|||
func (c *Client) ReadPump() {
|
||||
defer func() {
|
||||
c.Close()
|
||||
close(c.messageChan)
|
||||
}()
|
||||
|
||||
addr := c.RemoteAddr()
|
||||
|
|
Loading…
Reference in a new issue