fix: listener close panic

This commit is contained in:
wwqgtxx
2025-05-22 17:01:24 +08:00
parent 199fb8fd5d
commit 5a21bf3642
3 changed files with 8 additions and 4 deletions

View File

@@ -34,8 +34,8 @@ func (l *handleContextListener) init() {
}
}
}()
if c, err := l.handle(l.ctx, c); err == nil {
l.conns <- c
if conn, err := l.handle(l.ctx, c); err == nil {
l.conns <- conn
} else {
// handle failed, close the underlying connection.
_ = c.Close()