Skip to content

Commit

Permalink
fix: forgot to close the queue (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramzeng authored Aug 17, 2023
1 parent 1c442a0 commit 8e02cf8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion framedecoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ type FrameDecoder struct {
discardingTooLongFrame bool
tooLongFrameLength int64
bytesToDiscard int64
frameLengthInt int64
bytes []byte
lock sync.Mutex
}
Expand Down
7 changes: 0 additions & 7 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ func (cm *connectionManager) clearConnections() {
cm.connections = make(map[uint64]*Connection)
}

func (cm *connectionManager) connection(id uint64) *Connection {
cm.lock.RLock()
defer cm.lock.RUnlock()

return cm.connections[id]
}

func (cm *connectionManager) connectionsCount() int {
cm.lock.RLock()
defer cm.lock.RUnlock()
Expand Down
2 changes: 2 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ func (s *Server) stop() <-chan struct{} {
debug("Server stopping...")

s.cancel()

s.queue.close()
s.connectionManager.clearConnections()

debug("Server stopped")
Expand Down

0 comments on commit 8e02cf8

Please sign in to comment.