Update Netty to 4.1.44.Final and remove usage of some deprecated methods
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package net.md_5.bungee.entitymap;
|
||||
|
||||
import com.flowpowered.nbt.stream.NBTInputStream;
|
||||
import com.google.common.base.Throwables;
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufInputStream;
|
||||
@@ -257,7 +256,7 @@ public abstract class EntityMap
|
||||
new NBTInputStream( new ByteBufInputStream( packet ), false ).readTag();
|
||||
} catch ( IOException ex )
|
||||
{
|
||||
throw Throwables.propagate( ex );
|
||||
throw new RuntimeException( ex );
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
@@ -305,7 +304,7 @@ public abstract class EntityMap
|
||||
new NBTInputStream( new ByteBufInputStream( packet ), false ).readTag();
|
||||
} catch ( IOException ex )
|
||||
{
|
||||
throw Throwables.propagate( ex );
|
||||
throw new RuntimeException( ex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.EventLoop;
|
||||
import io.netty.handler.codec.http.DefaultHttpRequest;
|
||||
import io.netty.handler.codec.http.HttpHeaders;
|
||||
import io.netty.handler.codec.http.HttpHeaderNames;
|
||||
import io.netty.handler.codec.http.HttpMethod;
|
||||
import io.netty.handler.codec.http.HttpRequest;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
@@ -81,7 +81,7 @@ public class HttpClient
|
||||
String path = uri.getRawPath() + ( ( uri.getRawQuery() == null ) ? "" : "?" + uri.getRawQuery() );
|
||||
|
||||
HttpRequest request = new DefaultHttpRequest( HttpVersion.HTTP_1_1, HttpMethod.GET, path );
|
||||
request.headers().set( HttpHeaders.Names.HOST, uri.getHost() );
|
||||
request.headers().set( HttpHeaderNames.HOST, uri.getHost() );
|
||||
|
||||
future.channel().writeAndFlush( request );
|
||||
} else
|
||||
|
@@ -36,7 +36,7 @@ public class HttpHandler extends SimpleChannelInboundHandler<HttpObject>
|
||||
if ( msg instanceof HttpResponse )
|
||||
{
|
||||
HttpResponse response = (HttpResponse) msg;
|
||||
int responseCode = response.getStatus().code();
|
||||
int responseCode = response.status().code();
|
||||
|
||||
if ( responseCode == HttpResponseStatus.NO_CONTENT.code() )
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class HttpHandler extends SimpleChannelInboundHandler<HttpObject>
|
||||
|
||||
if ( responseCode != HttpResponseStatus.OK.code() )
|
||||
{
|
||||
throw new IllegalStateException( "Expected HTTP response 200 OK, got " + response.getStatus() );
|
||||
throw new IllegalStateException( "Expected HTTP response 200 OK, got " + response.status() );
|
||||
}
|
||||
}
|
||||
if ( msg instanceof HttpContent )
|
||||
|
@@ -3,7 +3,7 @@ package net.md_5.bungee.http;
|
||||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.handler.codec.http.HttpClientCodec;
|
||||
import io.netty.handler.ssl.SslContext;
|
||||
import io.netty.handler.ssl.SslContextBuilder;
|
||||
import io.netty.handler.ssl.SslHandler;
|
||||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -26,7 +26,7 @@ public class HttpInitializer extends ChannelInitializer<Channel>
|
||||
ch.pipeline().addLast( "timeout", new ReadTimeoutHandler( HttpClient.TIMEOUT, TimeUnit.MILLISECONDS ) );
|
||||
if ( ssl )
|
||||
{
|
||||
SSLEngine engine = SslContext.newClientContext().newEngine( ch.alloc(), host, port );
|
||||
SSLEngine engine = SslContextBuilder.forClient().build().newEngine( ch.alloc(), host, port );
|
||||
|
||||
ch.pipeline().addLast( "ssl", new SslHandler( engine ) );
|
||||
}
|
||||
|
Reference in New Issue
Block a user