Always print remote IP in InitialHandler

This commit is contained in:
md_5 2020-01-30 09:01:10 +11:00
parent 0cf27a0981
commit 7bd8a0276c

View File

@ -653,7 +653,20 @@ public class InitialHandler extends PacketHandler implements PendingConnection
@Override
public String toString()
{
return "[" + ( ( getName() != null ) ? getName() : getSocketAddress() ) + "] <-> InitialHandler";
StringBuilder sb = new StringBuilder();
sb.append( '[' );
String currentName = getName();
if ( currentName != null )
{
sb.append( currentName );
sb.append( ',' );
}
sb.append( getSocketAddress() );
sb.append( "] <-> InitialHandler" );
return sb.toString();
}
@Override