Skip to content

Commit

Permalink
Fix a regression in #223: sanitise selected closures (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnxme authored Aug 12, 2024
1 parent 2e6e133 commit 94cd399
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions layer4/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ func (a *App) Start() error {
case net.Listener:
a.listeners = append(a.listeners, ln)
lnAddr = caddy.JoinNetworkAddress(ln.Addr().Network(), ln.Addr().String(), "")
go func() { _ = s.serve(ln) }()
go func(s *Server, ln net.Listener) {
_ = s.serve(ln)
}(s, ln)
case net.PacketConn:
a.packetConns = append(a.packetConns, ln)
lnAddr = caddy.JoinNetworkAddress(ln.LocalAddr().Network(), ln.LocalAddr().String(), "")
go func() { _ = s.servePacket(ln) }()
go func(s *Server, pc net.PacketConn) {
_ = s.servePacket(pc)
}(s, ln)
}
s.logger.Debug("listening", zap.String("address", lnAddr))
}
Expand Down

0 comments on commit 94cd399

Please sign in to comment.