fix: resolve nethernet connection, ban deadlock, and nil RemoteAddr crashes
This commit is contained in:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user