fix: resolve nethernet connection, ban deadlock, and nil RemoteAddr crashes

This commit is contained in:
2026-07-12 15:30:55 +07:00
parent abe84fb542
commit 0e2c2f072a
4 changed files with 113 additions and 32 deletions
+5 -1
View File
@@ -176,7 +176,11 @@ func (conf Config) New(conn Conn) *Session {
if conf.Log == nil {
conf.Log = slog.Default()
}
conf.Log = conf.Log.With("name", conn.IdentityData().DisplayName, "uuid", conn.IdentityData().Identity, "raddr", conn.RemoteAddr().String())
raddr := "nethernet"
if addr := conn.RemoteAddr(); addr != nil {
raddr = addr.String()
}
conf.Log = conf.Log.With("name", conn.IdentityData().DisplayName, "uuid", conn.IdentityData().Identity, "raddr", raddr)
s := &Session{}
*s = Session{