Browse Source

Close websocket connection outside connection lock.

pull/183/head
Simon Eisenmann 11 years ago
parent
commit
84c7be8fe3
  1. 6
      src/app/spreed-webrtc-server/connection.go

6
src/app/spreed-webrtc-server/connection.go

@ -104,8 +104,12 @@ func (c *connection) Close() { @@ -104,8 +104,12 @@ func (c *connection) Close() {
c.mutex.Unlock()
return
}
c.ws.Close()
c.isClosed = true
c.mutex.Unlock()
// Unlock while we close the websocket connection.
c.ws.Close()
// Lock again to clean up the queue and send out the signal.
c.mutex.Lock()
for {
head := c.queue.Front()
if head == nil {

Loading…
Cancel
Save