Skip to content

Commit

Permalink
Merge branch 'main' into lukebakken/nil-for-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebakken committed Feb 9, 2023
2 parents 5f04849 + 30f5d55 commit 190c143
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,17 @@ func (c *Connection) dispatch0(f frame) {

func (c *Connection) dispatchN(f frame) {
c.m.Lock()
channel := c.channels[f.channel()]
updateChannel(f, channel)
channel, ok := c.channels[f.channel()]
if ok {
updateChannel(f, channel)
} else {
Logger.Printf("[debug] dropping frame, channel %d does not exist", f.channel())
}
c.m.Unlock()

// Note: this could result in concurrent dispatch depending on
// how channels are managed in an application
if channel != nil {
if ok {
channel.recv(channel, f)
} else {
c.dispatchClosed(f)
Expand Down

0 comments on commit 190c143

Please sign in to comment.