Skip to content

Commit

Permalink
udpmux: post drain() clear all routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous committed Aug 23, 2024
1 parent a0ad8a0 commit b834b1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion intra/udpmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,12 @@ func (x *muxer) stop() error {
func (x *muxer) drain() {
x.rmu.Lock()
defer x.rmu.Unlock()

defer clear(x.routes)
log.I("udp: mux: %s drain: closing %d demuxed conns", x.cid, len(x.routes))
for _, c := range x.routes {
clos(c) // will unroute as well
}

}

// readers has to tasks:
Expand Down

1 comment on commit b834b1e

@ignoramous
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#77

Please sign in to comment.