Add option to disable native code.

This commit is contained in:
md_5 2015-05-03 10:35:48 +10:00
parent fa828eba31
commit d1e1ce4cdb

View File

@ -199,19 +199,22 @@ public class BungeeCord extends ProxyServer
System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE ), true ) ); System.setErr( new PrintStream( new LoggingOutputStream( logger, Level.SEVERE ), true ) );
System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) ); System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) );
if ( EncryptionUtil.nativeFactory.load() ) if ( !Boolean.getBoolean( "net.md_5.bungee.native.disable" ) )
{ {
logger.info( "Using OpenSSL based native cipher." ); if ( EncryptionUtil.nativeFactory.load() )
} else {
{ logger.info( "Using OpenSSL based native cipher." );
logger.info( "Using standard Java JCE cipher. To enable the OpenSSL based native cipher, please make sure you are using 64 bit Ubuntu or Debian with libssl installed." ); } else
} {
if ( CompressFactory.zlib.load() ) logger.info( "Using standard Java JCE cipher. To enable the OpenSSL based native cipher, please make sure you are using 64 bit Ubuntu or Debian with libssl installed." );
{ }
logger.info( "Using native code compressor" ); if ( CompressFactory.zlib.load() )
} else {
{ logger.info( "Using native code compressor" );
logger.info( "Using standard Java compressor. To enable zero copy compression, run on 64 bit Linux" ); } else
{
logger.info( "Using standard Java compressor. To enable zero copy compression, run on 64 bit Linux" );
}
} }
} }